Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Exercises and Questions for Data Structures and Algorithms, Exams of Nursing

A collection of exercises and questions related to data structures and algorithms. It covers various topics, including arrays, linked lists, stacks, queues, trees, graphs, sorting, and searching. The exercises are designed to test understanding of fundamental concepts and problem-solving skills in this area. Suitable for students studying computer science or related fields.

Typology: Exams

2024/2025

Available from 01/07/2025

naomi-muthoni
naomi-muthoni 🇺🇸

4.5

(2)

552 documents

Partial preview of the text

Download Exercises and Questions for Data Structures and Algorithms and more Exams Nursing in PDF only on Docsity!

,-. / 01 2331455 67 589 :; 695 6 <= 472 > 2 ; 5 ;?@;@ 774 >;A 63 B 1 ;@< 8

96 ; 6 < 6 < 54156 < 8 7 B 1 >; 2615 CD? 2 >? 5 BEE 45 ;@ 16 ;? 4 < 94 = 2 >@ 3 > 61 = 2 ; 261

FB;;?@; 25 GB=E 4 =; 6 F 4 >@B 54 =F 8 : 58 >? 636 E 2 >@ 3 7 @>; 6 < 5 F 4 >@B 54 ;? 4

2331455 25 :< 4 > 4 = 4 =F 8 > 61732 >; 5 6 < 6 ;? 4 < 5 ;< 4556 < 5 21 H 16 D 1 @ 5 D? 2 >? 67

;? 4 76336 D 21 EI

JK.   L MNON!!P

Q-. / 0 > 61 = 2 ; 261 >?@<@>; 4 < 2 R 4 =F 8 ;? 4 : 4 < 561 E 2 A 21 E

@::< 6 S 29 @; 4 @ 15 D 4 < 5 CD 2 ;?> 36 B= 21 E 67 > 615 > 26 B 51455 C 7 < 4 TB 41 ; 38

@>> 69 :@ 124 =F 8 ?@ 33 B> 21 @; 2615 6 < 6 ;? 4 <= 2556 > 2 @; 2 A 4 C 569 @; 676 < 9 6 <

> 61 A 4 < 5261 589 :; 695 25

JK.# %M !NP

U-. /V? 2 >? 67 ;? 4 76336 D 21 E>@ 1 >@B 54 = 432 < 2 B 9 IW? 4 >H@ 33 ;?@;

@:: 38 X

JK.MO N MP

YK.%O!OZ P

[-. / 0 >B; 4 D 2 ;?=<@D@ 3 7 < 69 @ 3 > 6? 63 < 4 :< 4541 ; 5 D? 2 >?; 8 : 4

67 > 3212 >@ 3 :< 6 F 349 21 : 58 >? 6569 @; 2 > 94 = 2 > 214 I

JK.! NO OM ! 

NP

-. /]? 4 :< 21 > 2 :@ 3 ;? 46 < 4 ; 2 > 2 @ 1 ; 6 F< 21 E: 58 >? 4 @ 1 = 569 @

; 6 E 4 ;? 4 <D@ 5 D? 2 >? 67 ;? 4 76336 D 21 EI

JK.%LN !!P

^-. /V? 2 >? 67 ;? 4 76336 D 21 ED 6 B 3 = 16 ;F 4 21 > 3 B= 4 = 21 ;? 4

;< 4 @; 941 ;: 3 @ 176 <@:@; 241 ;D 2 ;? 2331455 @ 1 S 24 ; 8 = 256 <= 4 <I

JK. _OMZZO!`!L P

a-. /V? 2 >? 67 ;? 4 76336 D 21 E 25 > 61525 ; 41 ;D 2 ;?>B<< 41 ; 32 ; 4 <@;B< 4 @F 6 B;;? 4 < 43 @; 2615? 2 :F 4 ;D 441 6 F 5 ; 4 ;< 2 >@ 3 > 69 : 32 >@; 2615 @ 1 =@B; 259 5 : 4 >;<B 9 = 256 <= 4 < 5 b 0 cdeI JK.OZOZ     NO  !%)P f-. /]? 4 4 : 2 = 492636 E 8 < 43 @; 4 =; 6 H 34 :; 69 @ 12 @ 21 > 3 B= 45 D? 2 >? 67 ;? 476336 D 21 EI JK.g ON O!  O!!OhP

##% &'()*+@ 2 ABC.-D/

EFGHIJKILMNOJNIPNI /-D/.

.D .QNRSTTIUVSWXY@-D. 0 Z0 D

D..Z - 0 ..-D- -Z.[

@ 2 ABC/ 0 /Z 0 

]PWJIRWMN

^<_!((>')*!>?a*(8!(bc()dc_79()e _!((f(<8 *(!<!g>')" #h% &'()+,/.D/ i D-/-  .... 0 0 j=8' 6 7'" #k% &'()+, .-. /- -  /  . lmD.m ^)>(>e!>)n'e) 7 o" #p% &'()+ 2 -/..D-.. 0 .ZD0-.D  /.D 0  ./- ZD.  D  ) 9 !(g( 7 !9) 77" #q% &'()+ 4 . Z. r .D.-  0  a>>(<!:)gs) 7 =! 9 8 *(!t_7g uvwxyxvzv{|}~y€}y;*7 )8 ‚" #ƒ% &'()*+ 2 /Z .//. ZD .-/./..-D.-Z 0  ./  . /..[@. //.Z D/D..[@/.    ) 9 !(g!8*!" #„% &'()*+4 /.i. 0.-  //D[ j†'7) 7 `7"

 1234151678698 :;< 355835589 = 892 ;>? 8 @ 3? 683 << 9 A@ 321 ;B 8478 < 92 =C? 1928349 C 6

D"D!

'(,+E FGH.

IJ K!!LMN

'(O-EPQ*RS E.

I  N!#$"#

'(,+E FT U,--.

?  @A$#A

B!@!!

,-.C 06

D  &#$#"BE

B#'()%&#'()

##B"B$$###

,-F< 05 C0/< 50 = 4 <>= 0 >> 10  ; 4 C=CG

/ 0 = 513 > 0  ; 5 >H 6

I  J###$$#$#

,-K<;0>H5<= 5  L=C0 0< 0 /H

N  B#*BB##

B#!#B#BA

,-O P 33 > 5 C 6

Q  R#BB##B!B

AB"#B

,-:/ 0 >>3OC 5 4 S 4 3 5C 6

T  J###$A

B$#+

,-F 050 > 4  0 3 G> 3  6

7 U  # 8 VWXY$###$

B"B

B+

,-2 C0/ 4 C=C 35 3  5 Z= 5   05 = 5 C0 5 > 46

A B1% 1 '#" 1 #'&&' 0 %! 2 0 '&-+$$('#'!!

#'" 1 CDE 0 'F%! 2 0 %" 1 *$!"('#$GHIJ)'!" 1 J'&- 3

45 :  K L K K @

/)A+++&-.

1 )7; BC 8 D>

E  2 %!"#&,$%&%%$$%%

F 5 % 5 %+%$%% 4 -

()G:HIJ :I8BBJ K; L; KJ; 8

B= 8 MJ; 8 =; 8 J KN8 8 O>

P  2 % !"#&%Q 5 % 5 %

()G:;R; 8 SJ  ; 8 B= 8 MJ; 8 KBI 98 ;LB 8 ;D

; BKLLK 9 K:K;JO>

T  U+$%&%%$%&

()V =K BKBKJ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8 IIQt Ju =-%!-" 6 (-/ 6 " 22 " 5 %&')#/>/-) 0 %"#) 2 #/$ 62 )'+ 6 "#) ]vwx?,/)#?" 2 $ 7 ^E 9 GH Jy [/ 4 #"+,!-%)(#%!(/+(%&'%+$/ 6 %&/$)+ 5 - %!-" 6 (-/ 6 " 22 " 5 %&' 7   9 D 98 DFDz 9  9 H 8 < 8 D;GIH 9 I 9 ^ rapqgfpcdsjnfqpq{g 9 GI J| S-/(/#.+,!-"+".)(%! 2 %(/#) 22 ,#/ 6 /#+(" 5 - %!-" 6 (-/ 6 " 22 " 5 %&' 7 }XE:D^^;EGDO

%&: /'*3 0> -+ 4 ?-+.@:'>ABC 6

- .@ A1 B 3 AC A45 4  56

D  %!%&%!E!%)E

- .F 5 GH 0 4IJ 1 BK L4 1  6

M  !+&!#&!()%+)!!

$!%(!$%%!*#(!E

- .N A@CB 5 AO5 4  56

P  Q))R+%)*+)

- .S 50 C BT1 0 U 1 @ 3 4 5A 6

V  WR%!*%!)"!)"!

- .N 00 HX 1 L YZ[1  \ XG 5 ]A U 5 1  5 

A1 5 ^ 1 1 _ 6

`  Q))!+)()%+)

(&)+!'))*!ab+),

  • .@B 5 LL 0  \ cA1KdIBL\ 56 e  #)$+%)+&) %++!+%!+ ))!#!,
  • .[ 5 H 5 10 F 5 26 f  Q)) '#&%!)"!)",
  • .O 5  10 G 1 \ H 5 AA 5HAX 1  \ Ag 6   h+++$%*+&#$

@ 1  A 1 B

ABCDEFGEHIJK

!L# $ %M/, 0 / 58 +/( 85335 .,*<, 2 + 61 (-; 51 +,)= 132 ( 2 @

N/( 0 ?- 33 +/-+-== 34 O

P    P  

 Q  

RS# $ %M/, 0 / 58 +/( 85335 .,<, 2 05 * 2 , 2 +(+.,+/'()(+,-,

TUV@

  W  

RX# $ %Y 5 )-+ 5856 )', 256 '( 62 6 (= 6 ( 2 (+./, 0 /+ 4 =( 58 03 ,, 0 - 3

= 65 ; 3 (),= 240 / 525 )-+, 0 Z(', 0 ,(@

R[# $ %&+ 4 =( 58 '( 3 , 6 , 1 ) 0 /- 6 - 0 +( 6 ,:('; 4 = 240 / 5 ) 5 + 56

\ 

R]# $ %& 0 /, 3 '^_`) 5 *+/ 2 . 513 ';(( 7 =( 0 +('+ 5 ;(-; 3 (+ 5 ' 5

a bK  c    d ef Rg# $ %h/(&ijk, 2 )((+,<.,+/-=( 625 ./ 5 6 (= 56 + 2 - 8 - 20 ,-+, 5 .,+/ 8 , 6 ( 9 - 35 <.,+/ 6 ( 0166 (+'( 3 ,;( 6 - +(-'= 16 = 52 ( 813 2 (++,< 58 8 , 6 ( 2 Oh/(&ijk 6 (- 3 ,:( 2 +/-++/( 2 (;(/->, 562 - 6 ( 05 * 2 , 2 +(+ .,+/./, 0 / 58 +/( 85335 .,<', 256 '( 62 @   Rl# $ %M/, 0 / 58 +/( 85335 .,< 21 == 56 + 2 -< 55 '= 65 < 52 , 2 856 -=( 625 *.,+/- 05 *>( 62 , 5 *', 256 '( 6 @

@:AA

;B !&&&#$"

#"!!#&&$#%).$"$&&#"C>*"#>%+

D 8 E 3 FA 34  3 :

:GH2 3 

;I !&"#"&%"&

#"J>*"#>%+

K 9 91 9 LA 8 M

;N O&'""'"&"#"&&"%$."#$

P 22 A 8  8 Q

;R STUVW&%!".*&"X"$".""

YZ[\Z]Z^Z_abc\YZdc\ef\gdhdeid\bjke_el\kd\iYkmY\jYb]Zjkbdjn[ YZdc\k[^Zk[bc\Zdc\c^e]]bc\kdje\jYb]Zjkbdjn[\fZmbo\pYkmY\ef\jYb !."#&.&&&'..#%!")#& %&#%#+  6 qrstuvswx 3 : 88 yqrstuvswx: 2 ;z !"#'%%)%# $&&-"#"&"&'%()"'"%+  088 QL{ 7  2  8 |1 8 E 88 }~|:1 E 88 } 7 A 2 3  8  9 9E 88  ;€ !"..#"&#"$&"# #$$%%#-!."&")#&%&#%#+ ‚ 3 ƒ 8 M{„ 211  3 AM 2 AM: 2  : 3  2 A 9 }„ 211  3 AM 2  8 M yA 8 AM 2  2  2 : 8  2  ;  !"%".)&-&"#&& #$"#"!%).$"$&" †>$>%+ ~  2 ‡1L 9 1 

. 8 =?++ @9 <<*,AB/

?  @ 1 ABC$D

!D!D DD#$D!D!

""ED" D"!DF!

&'G- 4  33 >9 9 *+/

H  !D

D"!$""IJ#DJ!%

&'K. L. > +M >- >)- >N/

O   1 DD

!"D"P"$Q@

1 ABCDF%

&'R+- /

S  TFD!JD

!U" #D"

&'; L++** 8)>+- 3 - >=N+,-*++ > /

V   1 DDD#$#!

"D#D"D#

&'W- 3 )) *N/

X  YAZ!D"U$

!D!D"#D$DD

!" D%

&'[ 9 * - 3 +/

]  @ 1 ABC$^J#DJ!

DI!P#D!DF

&'_,-> 5  3 =) - 3 > 93 - 8 9-`LN-*L3>,-

,  3 >* 88 *-=+- 3 a>-) b/   

ABCDEF<E< B

GBCD ? <F <@HIJ

K 7 K( $,"$($6"(-,)$L L !#$%!("M$)('N$-$

1 A$!!%$#-+#&$&#$#,-++

#!$#-+,&@,#@#!$B-$ 2 

C 4 )D 8 7  7  7  7  7 <; 7 

7  E 7 F76 7 

G()H#-+!+&$!!#+/+!$,,@

!+!I?&.$##%$.!#-+$,$!

HJKL#

=L!#

1 >-&B?$&#

C 4 ) 3 M6N 78 :

6 7 C 3 D

O()*+!+$,+,$$-#.?$% 0 1 +! 2 +%%&

34 )P6:; 7;:F 7  7 Q:77

R 4 )P6:;;;  8  87  4 

S 4 )P6:; 9 < 9   7M< 8  7 : 7  7  9 

C 4 )D:7 7; 7 6:;  7 

T()*+!+$,+,$$-#.!$##-+##JKL 0

HU+#V!#&$-#& 2 &$

=U+#V!#%$.##-+

?+,@AB  2 . 0  6  0  0 

7 C.2 .

D -E- 2  0 F

G!#&!H:&!

I+J,CK  3 2  2  - 2 

-E 3 2 . 

 0  .-.  3 --J,CK/

G$( '!

7 L 0 >A .>

M  6 >

NO+ D--2 3 .  3  3 -

,M.

P!')! 8!

NN+ D--2 3  Q<,A>

7 R  

C>3 

S'&!"!#&!H:&!

NT+ < - 

@#@ 3 A& 3 )) 38 + 4998 +

B    

     C-- 

 1 >D/ 1 

E#E%'% 5 F 3 )+ 95 + 953 +G 996 +G 9 &+H+) 3 F 958 )I+F% 5 +J& 9 % 8 +K 7 4A+L+G 996 +

0   MN

!O>/ 

P     

Q-- 

O

0 RM 

@#S%)+%+T& 97 A+ 9 G+G&* 358 )I+%A 9 ' 9 T*U 3 )+G 9 &+ 3 && 9 &)+

V W  

2 #XFFA 6 %'+

Y 

8 %?+)@(. 6 ).(,(A*,BCD(C+E./+@(F,CE+ 6 )(

GH# =# #

I J<K  1 G<#  # 

L  1 ## 1

"L 4 

$%&''(.M()*+(,-./+(

N   OPQ( 

R   4 #  1 ## 1 

R   4 # 1##  

8 %S 6 )+CEB))+ 6 )(+TU'.@B/+( 7 [email protected] 7 +C() 9 UBA,'' 9 (B 6 AC+,@+@(B 6 (