Data Structures (Classroom Practice Booklet Solutions)

Size: px
Start display at page:

Download "Data Structures (Classroom Practice Booklet Solutions)"

Transcription

1

2 Dt Strutures (Clssroom Prtie Booklet Solutions). Arrys. Ans: o of A [] = +(+) = Here, j is Vrying lo. of Ai, j i rows j C In (i ) rows no. of elements, (i ) = i (i )/ lo of Ai, j [i(i ) / (j )] C. (i) By RMO, the lo. of A [, ] = + [ (+) + (-)] = + = (ii) By CMO, the lo of. () RMO: A [, ] = + [( ) + (+)] = Storge: 7 Eg: Retrievl: lo of A[i, j] D D = i rows j j C () CMO: Storge: 7 Retrievl: lo of Ai, j D D j ols i i In eh ol., il = j. o. of i, j [(j) ols (i j)] C A In (j ) ols The no. of elements is n n... n j j n... j n j lo. of A[i, j] nj j j j j C i j C ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

3 : : Dt Strutures. () RMO: Storge: 7 Retrievl: lo of Ai, j D D numer of elements in i rows j j euse j is Vrying Row jl exept st row i th (i ) lo. of i, j i j i A C () CMO: Storge: i j C 7 Retrievl: lo. of A[i, j] = + D + D Sine i is Vrying Col il j ols i i exept st olumn j th j- j j i j C j i C lo of A i, () Storge & Retrievl: 7 If i j = lo of Ai, j i i or (j jl) i.e., lo. of Ai, j i or j If i j = lo. of Ai, j (n ) i or j If i j = lo. of Ai, j n i or j ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

4 : : CSIT Postl Cohing Solutions. Z Mtrix:,,, re ntidigonl elements where i + j = N + Storge: st row lst row remining elements re 7 If i = lo of Ai, j j If i = n j lo of Ai, j n j If i + j = n + lo of Ai, j n i Algorithm: if (i = = ) return A[j ]; else if ( i = = n) return A[n + j ]; else if ( i + j = = n + ) return A [n + i ]; else return ;. 7 If i = o. of A[i, j] = + + j = j If i = n o. of A[i, j] = + n + j = n + j - If j = o. of A[i, j] = + n + n + i = n + i n n (n ) = ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

5 : : Dt Strutures. () A sequene mtrix of order n n is sid to e Toeplitz mtrix. If T [i, j] = T [i, j ], for ll i >, j >. Size = n x 7 7 x x x Ex: A [, ] = A[, ] ( = ) size of memory required for Toeplitz mtrix of order nn x 7 7 x x x n+ n = n () Storge nd retrievl: i j i > j If i j o. of A [i,j] = + [ + (j )] If i > j o. of A [i,j] = + [n+(i j )] if (i j) else return A[j i]; return A [n+i j ];. () Squre Bnd Mtrix: It is denoted y D n, where n is size of mtrix is (-) s digonls exists ove nd elow the mtrix digonl. D, = Size:- N (digonl elements ) + [N +N +N-+.+N ( )] = N+[( )N (+++.+ )] Totl no. of elements = n+ [n + n +. + n ( )] = n + [( ) n [++. + ( )]] n n = n+n( ) ( ) = n + ( ) [n ] ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

6 : : CSIT Postl Cohing Solutions Ex: In D, = + [ ] = + = elements () D, In D, A (,) in rd digonl In D, A (,) in th digonl (i) i j vlue is remined onstnt through out the digonl (ii)as vlue hnges, ordingly K vlue lso hnges. K vlue = (i j) lo. of A[i,j] = + no. of elements in(k ) dig + D ross Store D, : No. of elements in (k ) digonls is [n (-)]+[n ( )+] + [n ( ) + ] +. [n +(k )] [n ( )] st digonl euse it is( ) th digonl (n ( )+) nd digonl [n ( )+] rd digonl n +(k ) (k ) th term i.e. (k ) th digonl = (k ) (n ) k k(k ) = (k ) (n ) + lo. of A[i, j] = + k n k k j 7 lo. of A[i, j] = +no. of element in (k ) dig + (i il) or (j jl) ut here il is vrying digonl y digonl so prefer jl whih is lwys in eh digonl = + no. of elements in (k ) dig +(j ) ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

7 : : Dt Strutures. Stks & Queues. (i). Ans: () (ii). Ans: () Given rry size m, sy Numer of stks n, sy m i < n T[i] = B[i] = i. n i = T [] = B[] = = = i = T [] = B[] = = = i = T [] = B[] = = [] = when i = B [] = m = = (i) Push = overflow = size i B m T 7 th stk st stk nd stk m- 7 T B T B over flow ses T B T[i] = B [ i +] (ii) POP = under flow = initil B T 7 7 T[] T[] T[] B[] B[] B[] B[] T B T B under flow ses T[i] = B[i] T B. Ans: () Stk Stk Stk 7 7 B[] T[] T[] B[] Pop Pop Pop T[] B[] over flow B[] Arry ontents re,,,,,,, 7, ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

8 : 7 : CSIT Postl Cohing Solutions. Ans: () Queue one ontins elements. The element is to Pop is the th element of the queue. Dequeues from queue one + enqueues from queue one. enqueues from queue two + Dequeues from queue two the th element is nother Dequeue.. invotion til () T () = T () = T () = T () = stop Output:,, Totlly enqueues, Dequeues. Ans: (d) () Push () Push () Pop( ) Pop( ) Pop( ) () underflow Push () Push () Pop() Pop( ) :vlid Get top( ) = : vlid 7. hed (x) hed (x ) printf (x) hed (x ) hed() hed() printf(x) hed() repet () :vlid hed() print(x) hed() eft steps (d) Push () Push () Push () Pop( ) :Invlid Push() Pop Push() Pop( ) Is empty( ): true But given is flse so : Invlid hed () print (x) hed () Output:. Ans: (d) ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

9 . (i) x()=7 : : Dt Strutures Additions = f (n+) f() = f() = =. (i) (ii) x ( x [] ) x (7) 7 x() x() x() x() = x [] = 7 x(x[]) = 7 The no. of lls or invotions for evluting x(x[]) = Numer of lls for evluting f(n) = f (n+) x()+ x()+ + + = 7 n 7 Fi(n) Cll: Add:. (ii) Clulte the totl numer of lls in Fioni () = f() = = = 7 (iii) fi (7) fi () fi () fi () fi () fi () fi () fi () fi () fi () fi () fi () fi () Akermn(m, n) n if m Akermnm, if n Akermnm, Akermn(m, n ) otherwise (i) Akermn(, ) = A(, A(, )) = A(, 7) A(,) = A(, A(,)) = A(, ) = 7 A(,) = A(, A(,)) = A(, ) = A(, ) = A(,) = A(, ) = A(, A(, )) = A(, ) = + = ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

10 : : CSIT Postl Cohing Solutions A(, ) = A(, ) = A(, ) = + = A(,) = A(,A(, )) = A(, ) = + = A(,) = A(,A(, )) = A(, )= + = A(, ) = A(, A(, )) = A(, A(, A(, ))) = A(, A(, )) = A(, ) = + = 7 A(, 7) = A(, A(, )) = A(, A(, A(, ))) = A(, A(, 7)) = A(, ) = Akermn(, ) = (ii) Akermn(, ) = A(, A(, )) = A(, A(, A(, ))) = A(, A(, )) A(, ) = A(, ) = A(, A(, )) = A(, A(, A(, 7))) = A(, A(, )) = A(, ) = A(, ) = A(, A(, )) = A(, A(, A(, ))) = A(, A(, )) = A(, ) = Akermn(, ) = (iii) Akermn(, ) = (iv) Akermn(, ) = A(, ) A(,) = A(, A(, )) A(, ) = A(, ) A(, ) = A(, A(, )) A(, ) = A(, ) = A(, ) = A(, ) = A(, ) = A(, ) = A(, ) A(, ) = from (i) A(, ) = Akermn(, ) =. void TOH (int n, int ) { if (n! = ) { TOH (n,, R, M); } } void min ( ) { TOH (,,, ); } Eh disk moves for i where i =,, If there re disks then it moves for times = ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

11 : : Dt Strutures. () After N + lls we hve the first move. So fter lls we hve the first move. () After totl lls lls, we hve the lst move. () Totl moves N = 7 (d) Totl invotions = N+ = =. void TOH(int r, int, int m, int R) { if (n = =) printf : to R else { TOH (n,, R, M) printf( to R) TOH(n, M,, R) } void min( ) { TOH(,,, ); } moves = N lls = N+ ut with modified progrm. The numer of lls n e redued.. (i) Ans: (d) A * B CD + A * B C + D (ii) Ans: () A(B+C) * D (A * (B+C)) D A B+C D. = + * d/e + f g h i * j (i) Postfix: = + *d/e + fgh i*j = + *d/e + f g h i * j = +*d/e + f gh i*j = + d*e/+ fgh (i j *) = d * e/+fgh + ij* d*e/+fgh + ij* = (ii) Prefix: = + * d/e +( f gh) i * j = + *d/e + ( fgh) i * j = + /*de + fgh *ij = + /*de + fgh *ij = ++ /*defgh *ij = + + /*de fgh*ij = + + /*de f gh*ij ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

12 : : CSIT Postl Cohing Solutions. Ans: (d) 7. (i) * / + + * / + + / + + / ^ / * *. Ans: (),, +,,, /, *,, / = + = * = = (ii) ++ + / * ++ + / * ++ / ++ / ACE Engineering Pulitions Vlue of the postfix expression is. Ans: yz (i) (ii) (iii) yz (iv) yz Output is yz Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

13 : : Dt Strutures. R 7 F Size = u l + + = Given ondition () Bse (s) = Front (Q ) = () Front (Q ) = Bse (s) = = Until first is enountered, stk ontins So ++ = is enqueued in lo Until seond is enountered, stk ontins 7 So + 7 = is enqueued is Then simply nd re pushed in stk So the lotion of nd re nd. S Front. Ans () Suppose tht rry ontins Rer 7 7 Front S Initil onfigurtion: Dequeue( ) enqueue (x) nd enqueue (y) :. Ans: () The given reursive proedure simply reverses the order of elements in the queue. Beuse in every invotion the deleted q 7 7 Front q Rer R F Delete element F R Now two dded x y F R (R, F) = (,) Option (). Rer ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

14 : : CSIT Postl Cohing Solutions element is stored in i nd when the queue. eomes empty. Then the insert ( ) funtion ll will e ii exeuted from the very lst invoked d e f funtion ll. So, the lst deleted element will e inserted first nd the proedure goes first p i iii on Print = d. inked ists. It ompres the two lists ist nd ist if they re sme it returns true otherwise ist nd ist re different. () ist is ontented t the end of ist. () either uses null pointer dereferene or ppends list m to the end of list n.. P Q R S T - first The output is PQRST 7. Ans: () while (P) or while (P!= Null) while P is pointing to someody. Reursive routine for Count. It eomes irulr single inked ist euse loop termintes when temp = = Null.. ii d e f g first iii i p Print = d f d Return + Return + Return + Return + Return ll ll ll ll No. of nodes = ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

15 . Ans: () f f Before After ogi r q : : Dt Strutures. Ans: () inked stk push ( ) = insert front ( ) Initil Do( ) NU f Do() f. p Before f \. Do() f q v w x y z Opertion eft most Right most Middle Insert After Delete f v w x y z ontention of two single linked lists y hoosing lterntive nodes.. n link = M n Rlink = M Rlink n link Rlink = n n Rlink link = n. Ans: (d) Cur. Next = New Node (X, Cur. Next) iii iv (i) Strut Node * n = Get Node ( ) ; (ii) n dt = X ; (iii) n Next = Cur Next ; i x ii (iv) Cur Next = n n ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

16 : : CSIT Postl Cohing Solutions. Ans: (B) Inserts to the left of middle node in douly linked list.. Ans: () Before reverse: H d t : t link After reverse: H d 7. Ans: () It is n extension for the si single linked list. In irulr linked list insted of storing Null vlue in the lst node of single linked list, store the ddress of the st node (root) forms irulr linked list. Using irulr linked list it is possile to diretly trverse to the first node fter rehing the lst node nd so perform dditions nd deletions in O() time omplexity. For tht, rer node points to front node ut front node doesn t point to rer node. ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

17 : : Dt Strutures. Trees. void A (strut BTNode *t). { () Converse Preorder Algorithm Converse Preorder(node x) if(t) { { printf( %, t dt); if x Null B (t C); print(x.vlue) Converse Preorder(x.right) } B (t RC); A Converse Preorder(x. left) } B B } e A A () Converse Inorder f Algorithm Converse Inorder(node x) { if x NU B d A(t) = d f g e B g } Converse Inorder(x.right) Print(x.vlue) Converse Inorder(x.left) void B (strut BTNode *t) { if(t) { () Converse Postorder Algorithm Converse Postorder(node x) { if x NU Converse Postorder(x.right) Converse Postorder(x.left) Print(x.vlue) } } A (t C); printf( %, t dt); A (t RC); B A B B f A e } A A d g B(t) = d e f g ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

18 . void A(strut BTNode *t) { if(t) { printf( %, t dt); B (t RC); B (t C); } } void B (strut BTNode *t) { if(t) { A (t RC); printf( %, t dt); A (t C); } } e : 7 : CSIT Postl Cohing Solutions Note: The numer of inry trees n e formulted with unleled nodes re n C n n.. Ans:. Preorder : A B C D E F G In-order : B D C A F G E Post-order: D C B G F E A B D C d d B D C A F G E F G E f D C F G d g B(t) = egfd D G. 7. Note: If pre-order is given, long with terminl node informtion & ll right hild informtion the unique pttern n e found. If post-order is given long with Totlly distint trees possile terminl informtion nd ll left hild ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

19 : : Dt Strutures informtion the unique pttern n e. () Ans: identified. = I(n-)+ V = = I + V d V V t = null e V f V I =. Ans: () =. = = = d e f g Post- order : defg Pre-order: defg In-order: defg. Minimum =, Mximum = x xr. () Ans: ef nodes () = Totl nodes internl nodes = In+-I x xr x xr d = I(n-)+ = I =? = I( ) + = I + t=nu x xr e xr x g xr I = x f ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

20 : : CSIT Postl Cohing Solutions.. Before Swp After swp (, (e (f, g, h)),d) e e Prent of f, g, h is e. i.e. internl prenthesis hs hildren of prent whih is out of prenthesis. IV d d d III e e e II f g h I step. v ++ d d e e v v d. Given re trees A p B C q r To get the onverted inry tree of these given trees prent is not given we hve to ssume virtul prent v t = Null v v v e f V A p B C q r ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

21 : : Dt Strutures While trversing left ut the right node from. prent nd onnet it to the first left hild similrly seond to first third to seond nd so on. () () log x log A x. B P q C r () x!! (d) log x! log! Count the numer of trees in forest. x x 7. Ans: (d) left left Most hild nd Right s Right Siling (e) = Def: A left-most hild, right-siling inry tree is inry tree representtion of k-ry + tree. To form inry tree from n ritrry k-ry tree, the root of the originl tree is mde the root of the inry tree. Then, strting with the root, eh node's leftmost hild in the originl tree is mde its left hild in the inry tree, nd its nerest siling to the right in the originl tree is mde its right hild in the inry tree. + * / d e f g h i * j It ounts numer of leves in tree.. Ans: Expnded s ((+) ( )) + (( ) + (+)) = + = ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

22 : : CSIT Postl Cohing Solutions. Ans: ( + ) ( ) + ( ) + ( + ) = + ( ) =. SUN. MON TUE FRI SAT THU WED 7. 7,,,, 7, insert into empty inry serh tree. Ans: () Preorder =,,,, 7,,,,,, 7, Inorder =,, 7,,,,,,, 7,,,, 7,,,,,7,, 7 7,, 7, 7,, Element in the lowest level is 7. Return mximum vlue of the BST BST =, 7,,,,,, 7,,,, min mx ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

23 : : Dt Strutures. Ans: (d) () 7 (d) Not possile IN: not sorted order () 7 () 7 Not possile Not possile 7. BST deletion:- Proedure: Cse (i): No hildren: simply delete it Cse (ii): only one hild (or) sutree: onnet hild to its grnd prent. Cse (iii): Both hildren (or) su trees: reple with defult tion. i. Inorder suessor = minimum of RST ii. Inorder predeessor = lrgest to ST.. NH min N H H H NH H N(H) = + N(H-) + N (H-) N() = + N() + N() = + + = N() = +N()+N() = + + = 7 ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

24 : : CSIT Postl Cohing Solutions N() = + N(7) + N() = + + =.,,,,,,,,,,,, 7 + H 7 N(H) R + - R R + + R R R ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

25 : : Dt Strutures + R A E I R T V A E I K O R T S V 7. Delete, A + 7. A, V,, T, R, E, I, S, O, K R 7 A R V + A + T R V + Delete 7 7 Delete,, ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

26 : : CSIT Postl Cohing Solutions 7 + Delete. () Sequene of explortion V V V V V V V V 7 DFS Spnning tree is () Sequene of stk ontents. V V V V V V V. Grphs Delete 7 7 R Delete () Not pushed verties re V, V 7 (d) Verties re not pushed in more thn one V, V, V, V, V. () Sequene of explortion V V V V V V V 7 V () Sequene of stk ontents () Not pushed verties re V, V 7 (d) Verties re not pushed in more thn one V, V, V, V, V. () Sequene of explortion V V V V V V V 7 V () Sequene of stk ontents V V V V V V V V V V V V V V () Not pushed verties re V, V 7, V (d) Verties re not pushed in more thn one V, V, V ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

27 : : Dt Strutures. () invlid () vlid () (d) () vlid (d) vlid () () 7 7. Ans: (d) Step k only when lredy explored verties re there V V V () 7 (d) 7 V Trversl: BFS V V V V 7. () vlid () vlid V () invlid (d) vlid V V () () V V V V V ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

28 : 7 : CSIT Postl Cohing Solutions queue V V Dequeue queue V V V Dequeue queue V V V V 7 Dequeue queue V V V 7 V 7. () vlid () vlid () invlid (d) vlid. 7 g f e d strt Minimum possile reursion depth = (The dshed link nodes re explored while stepping kwrd.). Hshing. Ans: (d). Ans: (d). Ans: 7. Ans: () key: o:- 7 No. of ollisions = Mximum possile reursion depth = (The dshed link nodes re explored while stepping kwrd.) ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

29 : : Dt Strutures. Ans: () Keys Fold shifting h(k) = k% += + = + = ++ = ++ = () = ++ = ++ = 7 () = () ++ = Numer of Collisions =. (i) Hshing: (ist size: ) Modulo Division Collision Resolution: iner Proe Hshing Clultions % = 7 % = % = % = () 7 % = % = 7 % = () % = % = 7 Hshed ist (Collision) () () Collisions:. ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

30 : : CSIT Postl Cohing Solutions (ii) Hshing: (ist size: ) Digit Extrtion (,, ) + Modulo Division Collision Resolution: Qudrti Proe Hshing Clultions % = 7 7 % = % = + % = () % = 7 7 % = % = 7 % = % = + % = () () () Collisions:. % = Hshed ist (Collision) ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

31 : : Dt Strutures (iii). Hshing: (ist size: ) Mid Squre Collision Resolution: Rndom Numer ( * ddress ) % Hshing Clultions = % = 7 7 = 7 7 % = = % = ( * ) % () = % = 7 = % = ( * ) % ( * ) % () = % = 7 = % = 7 = % = ( * ) % ( * ) % ( * ) % ( * ) % ( * ) % () Hshed ist (Collision) () - - () () () Collisions:. ( * ) % () = % = ( * ) % ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

32 : : CSIT Postl Cohing Solutions (iv). Hshing: (ist size: ) Fold Shift Collision Resolution: iner Proe Hshing Clultions ( + + ) % = 7 ( ) % = ( + + ) % = ( + + ) % = 7 ( + + 7) % = ( + + ) % = 7 ( + + 7) % = ( + + ) % = ( + + ) % = 7 Hshed ist (Proe) Collisions:. (v). Hshing: (ist size: ) Rottion (right ), extrt (,, ),% + Collision Resolution: iner Proe Hshing Clultions % = % = % = 7 () ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

33 : : Dt Strutures % = % = % = 7 7 % = % = % = () - - Collisions:. () Hshed ist (Collision). Ans: () () Mximum Minimum (verge). Ans: () Resultnt hsh tle. In liner proing, we serh hsh tle sequentilly strting from the originl ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

34 : : CSIT Postl Cohing Solutions lotion. If lotion is oupied, we hek the next lotion. We wrp round from the lst tle lotion to the first tle lotion if neessry. Cse (II): To store Vrile prt Fixed prt 7. Ans: () A 7 B C D. Ans: () Cse (I): To store Vrile prt Fixed prt! = Sine is not getting ollided with ny other key, it n e moved to the vrile prt. Cse (I) & Cse (II) re mutully exlusive Cse (I) + Cse (II) = + = Totl different insertion sequenes. Ans: Slots = Elements = od ftor = = elements slots =! = ACE Engineering Pulitions Hyderd Delhi Bhopl Pune Bhuneswr uknow Ptn Bengluru Chenni Vijywd Vizg Tirupti Kuktplly Kolkt

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points:

Algorithms & Data Structures Homework 8 HS 18 Exercise Class (Room & TA): Submitted by: Peer Feedback by: Points: Eidgenössishe Tehnishe Hohshule Zürih Eole polytehnique fédérle de Zurih Politenio federle di Zurigo Federl Institute of Tehnology t Zurih Deprtement of Computer Siene. Novemer 0 Mrkus Püshel, Dvid Steurer

More information

CS 360 Exam 2 Fall 2014 Name

CS 360 Exam 2 Fall 2014 Name CS 360 Exm 2 Fll 2014 Nme 1. The lsses shown elow efine singly-linke list n stk. Write three ifferent O(n)-time versions of the reverse_print metho s speifie elow. Eh version of the metho shoul output

More information

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18

Global alignment. Genome Rearrangements Finding preserved genes. Lecture 18 Computt onl Biology Leture 18 Genome Rerrngements Finding preserved genes We hve seen before how to rerrnge genome to obtin nother one bsed on: Reversls Knowledge of preserved bloks (or genes) Now we re

More information

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4.

Tutorial Worksheet. 1. Find all solutions to the linear system by following the given steps. x + 2y + 3z = 2 2x + 3y + z = 4. Mth 5 Tutoril Week 1 - Jnury 1 1 Nme Setion Tutoril Worksheet 1. Find ll solutions to the liner system by following the given steps x + y + z = x + y + z = 4. y + z = Step 1. Write down the rgumented mtrix

More information

Project 6: Minigoals Towards Simplifying and Rewriting Expressions

Project 6: Minigoals Towards Simplifying and Rewriting Expressions MAT 51 Wldis Projet 6: Minigols Towrds Simplifying nd Rewriting Expressions The distriutive property nd like terms You hve proly lerned in previous lsses out dding like terms ut one prolem with the wy

More information

6. Suppose lim = constant> 0. Which of the following does not hold?

6. Suppose lim = constant> 0. Which of the following does not hold? CSE 0-00 Nme Test 00 points UTA Stuent ID # Multiple Choie Write your nswer to the LEFT of eh prolem 5 points eh The k lrgest numers in file of n numers n e foun using Θ(k) memory in Θ(n lg k) time using

More information

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of:

22: Union Find. CS 473u - Algorithms - Spring April 14, We want to maintain a collection of sets, under the operations of: 22: Union Fin CS 473u - Algorithms - Spring 2005 April 14, 2005 1 Union-Fin We wnt to mintin olletion of sets, uner the opertions of: 1. MkeSet(x) - rete set tht ontins the single element x. 2. Fin(x)

More information

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides.

1 PYTHAGORAS THEOREM 1. Given a right angled triangle, the square of the hypotenuse is equal to the sum of the squares of the other two sides. 1 PYTHAGORAS THEOREM 1 1 Pythgors Theorem In this setion we will present geometri proof of the fmous theorem of Pythgors. Given right ngled tringle, the squre of the hypotenuse is equl to the sum of the

More information

Probability. b a b. a b 32.

Probability. b a b. a b 32. Proility If n event n hppen in '' wys nd fil in '' wys, nd eh of these wys is eqully likely, then proility or the hne, or its hppening is, nd tht of its filing is eg, If in lottery there re prizes nd lnks,

More information

Data Structures (INE2011)

Data Structures (INE2011) Dt Strutures (INE2011) Eletronis nd Communition Engineering Hnyng University Hewoon Nm Leture 7 INE2011 Dt Strutures 1 Binry Tree Trversl Mny inry tree opertions re done y perorming trversl o the inry

More information

, g. Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g. Solution 1.

, g. Exercise 1. Generator polynomials of a convolutional code, given in binary form, are g. Solution 1. Exerise Genertor polynomils of onvolutionl ode, given in binry form, re g, g j g. ) Sketh the enoding iruit. b) Sketh the stte digrm. ) Find the trnsfer funtion T. d) Wht is the minimum free distne of

More information

Chapter 4 State-Space Planning

Chapter 4 State-Space Planning Leture slides for Automted Plnning: Theory nd Prtie Chpter 4 Stte-Spe Plnning Dn S. Nu CMSC 722, AI Plnning University of Mrylnd, Spring 2008 1 Motivtion Nerly ll plnning proedures re serh proedures Different

More information

p-adic Egyptian Fractions

p-adic Egyptian Fractions p-adic Egyptin Frctions Contents 1 Introduction 1 2 Trditionl Egyptin Frctions nd Greedy Algorithm 2 3 Set-up 3 4 p-greedy Algorithm 5 5 p-egyptin Trditionl 10 6 Conclusion 1 Introduction An Egyptin frction

More information

Instructions. An 8.5 x 11 Cheat Sheet may also be used as an aid for this test. MUST be original handwriting.

Instructions. An 8.5 x 11 Cheat Sheet may also be used as an aid for this test. MUST be original handwriting. ID: B CSE 2021 Computer Orgniztion Midterm Test (Fll 2009) Instrutions This is losed ook, 80 minutes exm. The MIPS referene sheet my e used s n id for this test. An 8.5 x 11 Chet Sheet my lso e used s

More information

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs

Counting Paths Between Vertices. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs. Isomorphism of Graphs Isomorphism of Grphs Definition The simple grphs G 1 = (V 1, E 1 ) n G = (V, E ) re isomorphi if there is ijetion (n oneto-one n onto funtion) f from V 1 to V with the property tht n re jent in G 1 if

More information

Reference : Croft & Davison, Chapter 12, Blocks 1,2. A matrix ti is a rectangular array or block of numbers usually enclosed in brackets.

Reference : Croft & Davison, Chapter 12, Blocks 1,2. A matrix ti is a rectangular array or block of numbers usually enclosed in brackets. I MATRIX ALGEBRA INTRODUCTION TO MATRICES Referene : Croft & Dvison, Chpter, Blos, A mtri ti is retngulr rr or lo of numers usull enlosed in rets. A m n mtri hs m rows nd n olumns. Mtri Alger Pge If the

More information

CISC 320 Introduction to Algorithms Spring 2014

CISC 320 Introduction to Algorithms Spring 2014 CISC 20 Introdution to Algorithms Spring 2014 Leture 9 Red-Blk Trees Courtes of Prof. Lio Li 1 Binr Serh Trees (BST) ke[x]: ke stored t x. left[x]: pointer to left hild of x. right[x]: pointer to right

More information

Convert the NFA into DFA

Convert the NFA into DFA Convert the NF into F For ech NF we cn find F ccepting the sme lnguge. The numer of sttes of the F could e exponentil in the numer of sttes of the NF, ut in prctice this worst cse occurs rrely. lgorithm:

More information

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations.

Lecture 3. In this lecture, we will discuss algorithms for solving systems of linear equations. Lecture 3 3 Solving liner equtions In this lecture we will discuss lgorithms for solving systems of liner equtions Multiplictive identity Let us restrict ourselves to considering squre mtrices since one

More information

Matrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix

Matrices SCHOOL OF ENGINEERING & BUILT ENVIRONMENT. Mathematics (c) 1. Definition of a Matrix tries Definition of tri mtri is regulr rry of numers enlosed inside rkets SCHOOL OF ENGINEERING & UIL ENVIRONEN Emple he following re ll mtries: ), ) 9, themtis ), d) tries Definition of tri Size of tri

More information

Linear Algebra Introduction

Linear Algebra Introduction Introdution Wht is Liner Alger out? Liner Alger is rnh of mthemtis whih emerged yers k nd ws one of the pioneer rnhes of mthemtis Though, initilly it strted with solving of the simple liner eqution x +

More information

MA 513: Data Structures Lecture Note Partha Sarathi Mandal

MA 513: Data Structures Lecture Note  Partha Sarathi Mandal MA 513: Dt Structures Lecture Note http://www.iitg.ernet.in/psm/indexing_m513/y09/index.html Prth Srthi Mndl psm@iitg.ernet.in Dept. of Mthemtics, IIT Guwhti Tue 9:00-9:55 Wed 10:00-10:55 Thu 11:00-11:55

More information

Arrow s Impossibility Theorem

Arrow s Impossibility Theorem Rep Fun Gme Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Fun Gme Properties Arrow s Theorem Leture Overview 1 Rep 2 Fun Gme 3 Properties

More information

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106

18.06 Problem Set 4 Due Wednesday, Oct. 11, 2006 at 4:00 p.m. in 2-106 8. Problem Set Due Wenesy, Ot., t : p.m. in - Problem Mony / Consier the eight vetors 5, 5, 5,..., () List ll of the one-element, linerly epenent sets forme from these. (b) Wht re the two-element, linerly

More information

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS

CS 310 (sec 20) - Winter Final Exam (solutions) SOLUTIONS CS 310 (sec 20) - Winter 2003 - Finl Exm (solutions) SOLUTIONS 1. (Logic) Use truth tles to prove the following logicl equivlences: () p q (p p) (q q) () p q (p q) (p q) () p q p q p p q q (q q) (p p)

More information

System Validation (IN4387) November 2, 2012, 14:00-17:00

System Validation (IN4387) November 2, 2012, 14:00-17:00 System Vlidtion (IN4387) Novemer 2, 2012, 14:00-17:00 Importnt Notes. The exmintion omprises 5 question in 4 pges. Give omplete explntion nd do not onfine yourself to giving the finl nswer. Good luk! Exerise

More information

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4

CSE 332. Sorting. Data Abstractions. CSE 332: Data Abstractions. QuickSort Cutoff 1. Where We Are 2. Bounding The MAXIMUM Problem 4 Am Blnk Leture 13 Winter 2016 CSE 332 CSE 332: Dt Astrtions Sorting Dt Astrtions QuikSort Cutoff 1 Where We Are 2 For smll n, the reursion is wste. The onstnts on quik/merge sort re higher thn the ones

More information

Arrow s Impossibility Theorem

Arrow s Impossibility Theorem Rep Voting Prdoxes Properties Arrow s Theorem Arrow s Impossiility Theorem Leture 12 Arrow s Impossiility Theorem Leture 12, Slide 1 Rep Voting Prdoxes Properties Arrow s Theorem Leture Overview 1 Rep

More information

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals

AP Calculus BC Chapter 8: Integration Techniques, L Hopital s Rule and Improper Integrals AP Clulus BC Chpter 8: Integrtion Tehniques, L Hopitl s Rule nd Improper Integrls 8. Bsi Integrtion Rules In this setion we will review vrious integrtion strtegies. Strtegies: I. Seprte the integrnd into

More information

Special Numbers, Factors and Multiples

Special Numbers, Factors and Multiples Specil s, nd Student Book - Series H- + 3 + 5 = 9 = 3 Mthletics Instnt Workooks Copyright Student Book - Series H Contents Topics Topic - Odd, even, prime nd composite numers Topic - Divisiility tests

More information

CS 491G Combinatorial Optimization Lecture Notes

CS 491G Combinatorial Optimization Lecture Notes CS 491G Comintoril Optimiztion Leture Notes Dvi Owen July 30, August 1 1 Mthings Figure 1: two possile mthings in simple grph. Definition 1 Given grph G = V, E, mthing is olletion of eges M suh tht e i,

More information

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then.

April 8, 2017 Math 9. Geometry. Solving vector problems. Problem. Prove that if vectors and satisfy, then. pril 8, 2017 Mth 9 Geometry Solving vetor prolems Prolem Prove tht if vetors nd stisfy, then Solution 1 onsider the vetor ddition prllelogrm shown in the Figure Sine its digonls hve equl length,, the prllelogrm

More information

CIT 596 Theory of Computation 1. Graphs and Digraphs

CIT 596 Theory of Computation 1. Graphs and Digraphs CIT 596 Theory of Computtion 1 A grph G = (V (G), E(G)) onsists of two finite sets: V (G), the vertex set of the grph, often enote y just V, whih is nonempty set of elements lle verties, n E(G), the ege

More information

First Midterm Examination

First Midterm Examination 24-25 Fll Semester First Midterm Exmintion ) Give the stte digrm of DFA tht recognizes the lnguge A over lphet Σ = {, } where A = {w w contins or } 2) The following DFA recognizes the lnguge B over lphet

More information

Lecture 6: Coding theory

Lecture 6: Coding theory Leture 6: Coing theory Biology 429 Crl Bergstrom Ferury 4, 2008 Soures: This leture loosely follows Cover n Thoms Chpter 5 n Yeung Chpter 3. As usul, some of the text n equtions re tken iretly from those

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 5 Supplement Greedy Algorithms Cont d Minimizing lteness Ching (NOT overed in leture) Adm Smith 9/8/10 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov,

More information

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors:

Vectors , (0,0). 5. A vector is commonly denoted by putting an arrow above its symbol, as in the picture above. Here are some 3-dimensional vectors: Vectors 1-23-2018 I ll look t vectors from n lgeric point of view nd geometric point of view. Algericlly, vector is n ordered list of (usully) rel numers. Here re some 2-dimensionl vectors: (2, 3), ( )

More information

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year

USA Mathematical Talent Search Round 1 Solutions Year 21 Academic Year 1/1/21. Fill in the circles in the picture t right with the digits 1-8, one digit in ech circle with no digit repeted, so tht no two circles tht re connected by line segment contin consecutive digits.

More information

Bases for Vector Spaces

Bases for Vector Spaces Bses for Vector Spces 2-26-25 A set is independent if, roughly speking, there is no redundncy in the set: You cn t uild ny vector in the set s liner comintion of the others A set spns if you cn uild everything

More information

Data Structures LECTURE 10. Huffman coding. Example. Coding: problem definition

Data Structures LECTURE 10. Huffman coding. Example. Coding: problem definition Dt Strutures, Spring 24 L. Joskowiz Dt Strutures LEURE Humn oing Motivtion Uniquel eipherle oes Prei oes Humn oe onstrution Etensions n pplitions hpter 6.3 pp 385 392 in tetook Motivtion Suppose we wnt

More information

ECON 331 Lecture Notes: Ch 4 and Ch 5

ECON 331 Lecture Notes: Ch 4 and Ch 5 Mtrix Algebr ECON 33 Lecture Notes: Ch 4 nd Ch 5. Gives us shorthnd wy of writing lrge system of equtions.. Allows us to test for the existnce of solutions to simultneous systems. 3. Allows us to solve

More information

XML and Databases. Exam Preperation Discuss Answers to last year s exam. Sebastian Maneth NICTA and UNSW

XML and Databases. Exam Preperation Discuss Answers to last year s exam. Sebastian Maneth NICTA and UNSW XML n Dtses Exm Prepertion Disuss Answers to lst yer s exm Sestin Mneth NICTA n UNSW CSE@UNSW -- Semester 1, 2008 (1) For eh of the following, explin why it is not well-forme XML (is WFC or the XML grmmr

More information

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS

The University of Nottingham SCHOOL OF COMPUTER SCIENCE A LEVEL 2 MODULE, SPRING SEMESTER MACHINES AND THEIR LANGUAGES ANSWERS The University of ottinghm SCHOOL OF COMPUTR SCIC A LVL 2 MODUL, SPRIG SMSTR 2015 2016 MACHIS AD THIR LAGUAGS ASWRS Time llowed TWO hours Cndidtes my omplete the front over of their nswer ook nd sign their

More information

September 13 Homework Solutions

September 13 Homework Solutions College of Engineering nd Computer Science Mechnicl Engineering Deprtment Mechnicl Engineering 5A Seminr in Engineering Anlysis Fll Ticket: 5966 Instructor: Lrry Cretto Septemer Homework Solutions. Are

More information

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh

Computational Biology Lecture 18: Genome rearrangements, finding maximal matches Saad Mneimneh Computtionl Biology Leture 8: Genome rerrngements, finding miml mthes Sd Mneimneh We hve seen how to rerrnge genome to otin nother one sed on reversls nd the knowledge of the preserved loks or genes. Now

More information

Search: The Core of Planning

Search: The Core of Planning Serch: The Core of Plnning Dr. Neil T. Dntm CSCI-498/598 RPM, Colordo School of Mines Spring 208 Dntm (Mines CSCI, RPM) Serch Spring 208 / 75 Outline Plnning nd Serch Problems Bsic Serch Depth-First Serch

More information

Necessary and sucient conditions for some two. Abstract. Further we show that the necessary conditions for the existence of an OD(44 s 1 s 2 )

Necessary and sucient conditions for some two. Abstract. Further we show that the necessary conditions for the existence of an OD(44 s 1 s 2 ) Neessry n suient onitions for some two vrile orthogonl esigns in orer 44 C. Koukouvinos, M. Mitrouli y, n Jennifer Seerry z Deite to Professor Anne Penfol Street Astrt We give new lgorithm whih llows us

More information

Lecture 3. XML Into RDBMS. XML and Databases. Memory Representations. Memory Representations. Traversals and Pre/Post-Encoding. Memory Representations

Lecture 3. XML Into RDBMS. XML and Databases. Memory Representations. Memory Representations. Traversals and Pre/Post-Encoding. Memory Representations Leture XML into RDBMS XML n Dtses Sestin Mneth NICTA n UNSW Leture XML Into RDBMS CSE@UNSW -- Semester, 00 Memory Representtions Memory Representtions Fts DOM is esy to use, ut memory hevy. in-memory size

More information

First Midterm Examination

First Midterm Examination Çnky University Deprtment of Computer Engineering 203-204 Fll Semester First Midterm Exmintion ) Design DFA for ll strings over the lphet Σ = {,, c} in which there is no, no nd no cc. 2) Wht lnguge does

More information

INTRODUCTION TO LINEAR ALGEBRA

INTRODUCTION TO LINEAR ALGEBRA ME Applied Mthemtics for Mechnicl Engineers INTRODUCTION TO INEAR AGEBRA Mtrices nd Vectors Prof. Dr. Bülent E. Pltin Spring Sections & / ME Applied Mthemtics for Mechnicl Engineers INTRODUCTION TO INEAR

More information

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs

Connected-components. Summary of lecture 9. Algorithms and Data Structures Disjoint sets. Example: connected components in graphs Prm University, Mth. Deprtment Summry of lecture 9 Algorithms nd Dt Structures Disjoint sets Summry of this lecture: (CLR.1-3) Dt Structures for Disjoint sets: Union opertion Find opertion Mrco Pellegrini

More information

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution

Technische Universität München Winter term 2009/10 I7 Prof. J. Esparza / J. Křetínský / M. Luttenberger 11. Februar Solution Tehnishe Universität Münhen Winter term 29/ I7 Prof. J. Esprz / J. Křetínský / M. Luttenerger. Ferur 2 Solution Automt nd Forml Lnguges Homework 2 Due 5..29. Exerise 2. Let A e the following finite utomton:

More information

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours

Mid-Term Examination - Spring 2014 Mathematical Programming with Applications to Economics Total Score: 45; Time: 3 hours Mi-Term Exmintion - Spring 0 Mthemtil Progrmming with Applitions to Eonomis Totl Sore: 5; Time: hours. Let G = (N, E) e irete grph. Define the inegree of vertex i N s the numer of eges tht re oming into

More information

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer

(e) if x = y + z and a divides any two of the integers x, y, or z, then a divides the remaining integer Divisibility In this note we introduce the notion of divisibility for two integers nd b then we discuss the division lgorithm. First we give forml definition nd note some properties of the division opertion.

More information

CS241 Week 6 Tutorial Solutions

CS241 Week 6 Tutorial Solutions 241 Week 6 Tutoril olutions Lnguges: nning & ontext-free Grmmrs Winter 2018 1 nning Exerises 1. 0x0x0xd HEXINT 0x0 I x0xd 2. 0xend--- HEXINT 0xe I nd ER -- MINU - 3. 1234-120x INT 1234 INT -120 I x 4.

More information

Preview 11/1/2017. Greedy Algorithms. Coin Change. Coin Change. Coin Change. Coin Change. Greedy algorithms. Greedy Algorithms

Preview 11/1/2017. Greedy Algorithms. Coin Change. Coin Change. Coin Change. Coin Change. Greedy algorithms. Greedy Algorithms Preview Greed Algorithms Greed Algorithms Coin Chnge Huffmn Code Greed lgorithms end to e simple nd strightforwrd. Are often used to solve optimiztion prolems. Alws mke the choice tht looks est t the moment,

More information

Closure Properties of Regular Languages

Closure Properties of Regular Languages Closure Properties of Regulr Lnguges Regulr lnguges re closed under mny set opertions. Let L 1 nd L 2 e regulr lnguges. (1) L 1 L 2 (the union) is regulr. (2) L 1 L 2 (the conctention) is regulr. (3) L

More information

Individual Group. Individual Events I1 If 4 a = 25 b 1 1. = 10, find the value of.

Individual Group. Individual Events I1 If 4 a = 25 b 1 1. = 10, find the value of. Answers: (000-0 HKMO Het Events) Creted y: Mr. Frnis Hung Lst udted: July 0 00-0 33 3 7 7 5 Individul 6 7 7 3.5 75 9 9 0 36 00-0 Grou 60 36 3 0 5 6 7 7 0 9 3 0 Individul Events I If = 5 = 0, find the vlue

More information

NON-DETERMINISTIC FSA

NON-DETERMINISTIC FSA Tw o types of non-determinism: NON-DETERMINISTIC FS () Multiple strt-sttes; strt-sttes S Q. The lnguge L(M) ={x:x tkes M from some strt-stte to some finl-stte nd ll of x is proessed}. The string x = is

More information

QUADRATIC EQUATION. Contents

QUADRATIC EQUATION. Contents QUADRATIC EQUATION Contents Topi Pge No. Theory 0-04 Exerise - 05-09 Exerise - 09-3 Exerise - 3 4-5 Exerise - 4 6 Answer Key 7-8 Syllus Qudrti equtions with rel oeffiients, reltions etween roots nd oeffiients,

More information

Things to Memorize: A Partial List. January 27, 2017

Things to Memorize: A Partial List. January 27, 2017 Things to Memorize: A Prtil List Jnury 27, 2017 Chpter 2 Vectors - Bsic Fcts A vector hs mgnitude (lso clled size/length/norm) nd direction. It does not hve fixed position, so the sme vector cn e moved

More information

Introduction To Matrices MCV 4UI Assignment #1

Introduction To Matrices MCV 4UI Assignment #1 Introduction To Mtrices MCV UI Assignment # INTRODUCTION: A mtrix plurl: mtrices) is rectngulr rry of numbers rrnged in rows nd columns Exmples: ) b) c) [ ] d) Ech number ppering in the rry is sid to be

More information

AVL Trees. D Oisín Kidney. August 2, 2018

AVL Trees. D Oisín Kidney. August 2, 2018 AVL Trees D Oisín Kidne August 2, 2018 Astrt This is verified implementtion of AVL trees in Agd, tking ides primril from Conor MBride s pper How to Keep Your Neighours in Order [2] nd the Agd stndrd lirr

More information

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014

CS 2204 DIGITAL LOGIC & STATE MACHINE DESIGN SPRING 2014 S 224 DIGITAL LOGI & STATE MAHINE DESIGN SPRING 214 DUE : Mrh 27, 214 HOMEWORK III READ : Relte portions of hpters VII n VIII ASSIGNMENT : There re three questions. Solve ll homework n exm prolems s shown

More information

50 AMC Lectures Problem Book 2 (36) Substitution Method

50 AMC Lectures Problem Book 2 (36) Substitution Method 0 AMC Letures Prolem Book Sustitution Metho PROBLEMS Prolem : Solve for rel : 9 + 99 + 9 = Prolem : Solve for rel : 0 9 8 8 Prolem : Show tht if 8 Prolem : Show tht + + if rel numers,, n stisf + + = Prolem

More information

Welcome. Balanced search trees. Balanced Search Trees. Inge Li Gørtz

Welcome. Balanced search trees. Balanced Search Trees. Inge Li Gørtz Welome nge Li Gørt. everse tehing n isussion of exerises: 02110 nge Li Gørt 3 tehing ssistnts 8.00-9.15 Group work 9.15-9.45 isussions of your solutions in lss 10.00-11.15 Leture 11.15-11.45 Work on exerises

More information

5. Every rational number have either terminating or repeating (recurring) decimal representation.

5. Every rational number have either terminating or repeating (recurring) decimal representation. CHAPTER NUMBER SYSTEMS Points to Rememer :. Numer used for ounting,,,,... re known s Nturl numers.. All nturl numers together with zero i.e. 0,,,,,... re known s whole numers.. All nturl numers, zero nd

More information

CS 573 Automata Theory and Formal Languages

CS 573 Automata Theory and Formal Languages Non-determinism Automt Theory nd Forml Lnguges Professor Leslie Lnder Leture # 3 Septemer 6, 2 To hieve our gol, we need the onept of Non-deterministi Finite Automton with -moves (NFA) An NFA is tuple

More information

PYTHAGORAS THEOREM WHAT S IN CHAPTER 1? IN THIS CHAPTER YOU WILL:

PYTHAGORAS THEOREM WHAT S IN CHAPTER 1? IN THIS CHAPTER YOU WILL: PYTHAGORAS THEOREM 1 WHAT S IN CHAPTER 1? 1 01 Squres, squre roots nd surds 1 02 Pythgors theorem 1 03 Finding the hypotenuse 1 04 Finding shorter side 1 05 Mixed prolems 1 06 Testing for right-ngled tringles

More information

Chapter 2. Determinants

Chapter 2. Determinants Chpter Determinnts The Determinnt Function Recll tht the X mtrix A c b d is invertible if d-bc0. The expression d-bc occurs so frequently tht it hs nme; it is clled the determinnt of the mtrix A nd is

More information

Algorithm Design and Analysis

Algorithm Design and Analysis Algorithm Design nd Anlysis LECTURE 8 Mx. lteness ont d Optiml Ching Adm Smith 9/12/2008 A. Smith; sed on slides y E. Demine, C. Leiserson, S. Rskhodnikov, K. Wyne Sheduling to Minimizing Lteness Minimizing

More information

Factorising FACTORISING.

Factorising FACTORISING. Ftorising FACTORISING www.mthletis.om.u Ftorising FACTORISING Ftorising is the opposite of expning. It is the proess of putting expressions into rkets rther thn expning them out. In this setion you will

More information

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio.

Geometric Sequences. Geometric Sequence a sequence whose consecutive terms have a common ratio. Geometric Sequences Geometric Sequence sequence whose consecutive terms hve common rtio. Geometric Sequence A sequence is geometric if the rtios of consecutive terms re the sme. 2 3 4... 2 3 The number

More information

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6

CS311 Computational Structures Regular Languages and Regular Grammars. Lecture 6 CS311 Computtionl Strutures Regulr Lnguges nd Regulr Grmmrs Leture 6 1 Wht we know so fr: RLs re losed under produt, union nd * Every RL n e written s RE, nd every RE represents RL Every RL n e reognized

More information

= state, a = reading and q j

= state, a = reading and q j 4 Finite Automt CHAPTER 2 Finite Automt (FA) (i) Derterministi Finite Automt (DFA) A DFA, M Q, q,, F, Where, Q = set of sttes (finite) q Q = the strt/initil stte = input lphet (finite) (use only those

More information

CS 314 Principles of Programming Languages

CS 314 Principles of Programming Languages C 314 Principles of Progrmming Lnguges Lecture 6: LL(1) Prsing Zheng (Eddy) Zhng Rutgers University Ferury 5, 2018 Clss Informtion Homework 2 due tomorrow. Homework 3 will e posted erly next week. 2 Top

More information

Lesson 2.1 Inductive Reasoning

Lesson 2.1 Inductive Reasoning Lesson 2.1 Inutive Resoning Nme Perio Dte For Eerises 1 7, use inutive resoning to fin the net two terms in eh sequene. 1. 4, 8, 12, 16,, 2. 400, 200, 100, 50, 25,, 3. 1 8, 2 7, 1 2, 4, 5, 4. 5, 3, 2,

More information

Module 9: Tries and String Matching

Module 9: Tries and String Matching Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer

More information

Module 9: Tries and String Matching

Module 9: Tries and String Matching Module 9: Tries nd String Mtching CS 240 - Dt Structures nd Dt Mngement Sjed Hque Veronik Irvine Tylor Smith Bsed on lecture notes by mny previous cs240 instructors Dvid R. Cheriton School of Computer

More information

Discrete Structures Lecture 11

Discrete Structures Lecture 11 Introdution Good morning. In this setion we study funtions. A funtion is mpping from one set to nother set or, perhps, from one set to itself. We study the properties of funtions. A mpping my not e funtion.

More information

Polynomials. Polynomials. Curriculum Ready ACMNA:

Polynomials. Polynomials. Curriculum Ready ACMNA: Polynomils Polynomils Curriulum Redy ACMNA: 66 www.mthletis.om Polynomils POLYNOMIALS A polynomil is mthemtil expression with one vrile whose powers re neither negtive nor frtions. The power in eh expression

More information

QUADRATIC EQUATION EXERCISE - 01 CHECK YOUR GRASP

QUADRATIC EQUATION EXERCISE - 01 CHECK YOUR GRASP QUADRATIC EQUATION EXERCISE - 0 CHECK YOUR GRASP. Sine sum of oeffiients 0. Hint : It's one root is nd other root is 8 nd 5 5. tn other root 9. q 4p 0 q p q p, q 4 p,,, 4 Hene 7 vlues of (p, q) 7 equtions

More information

Lecture 3. Introduction digital logic. Notes. Notes. Notes. Representations. February Bern University of Applied Sciences.

Lecture 3. Introduction digital logic. Notes. Notes. Notes. Representations. February Bern University of Applied Sciences. Lecture 3 Ferury 6 ern University of pplied ciences ev. f57fc 3. We hve seen tht circuit cn hve multiple (n) inputs, e.g.,, C, We hve lso seen tht circuit cn hve multiple (m) outputs, e.g. X, Y,, ; or

More information

VECTOR ALGEBRA. Syllabus :

VECTOR ALGEBRA. Syllabus : MV VECTOR ALGEBRA Syllus : Vetors nd Slrs, ddition of vetors, omponent of vetor, omponents of vetor in two dimensions nd three dimensionl spe, slr nd vetor produts, slr nd vetor triple produt. Einstein

More information

a) Read over steps (1)- (4) below and sketch the path of the cycle on a P V plot on the graph below. Label all appropriate points.

a) Read over steps (1)- (4) below and sketch the path of the cycle on a P V plot on the graph below. Label all appropriate points. Prole 3: Crnot Cyle of n Idel Gs In this prole, the strting pressure P nd volue of n idel gs in stte, re given he rtio R = / > of the volues of the sttes nd is given Finlly onstnt γ = 5/3 is given You

More information

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite!

Solutions for HW9. Bipartite: put the red vertices in V 1 and the black in V 2. Not bipartite! Solutions for HW9 Exerise 28. () Drw C 6, W 6 K 6, n K 5,3. C 6 : W 6 : K 6 : K 5,3 : () Whih of the following re iprtite? Justify your nswer. Biprtite: put the re verties in V 1 n the lk in V 2. Biprtite:

More information

8 THREE PHASE A.C. CIRCUITS

8 THREE PHASE A.C. CIRCUITS 8 THREE PHSE.. IRUITS The signls in hpter 7 were sinusoidl lternting voltges nd urrents of the so-lled single se type. n emf of suh type n e esily generted y rotting single loop of ondutor (or single winding),

More information

Non Right Angled Triangles

Non Right Angled Triangles Non Right ngled Tringles Non Right ngled Tringles urriulum Redy www.mthletis.om Non Right ngled Tringles NON RIGHT NGLED TRINGLES sin i, os i nd tn i re lso useful in non-right ngled tringles. This unit

More information

Where did dynamic programming come from?

Where did dynamic programming come from? Where did dynmic progrmming come from? String lgorithms Dvid Kuchk cs302 Spring 2012 Richrd ellmn On the irth of Dynmic Progrmming Sturt Dreyfus http://www.eng.tu.c.il/~mi/cd/ or50/1526-5463-2002-50-01-0048.pdf

More information

Common intervals of genomes. Mathieu Raffinot CNRS LIAFA

Common intervals of genomes. Mathieu Raffinot CNRS LIAFA Common intervls of genomes Mthieu Rffinot CNRS LIF Context: omprtive genomis. set of genomes prtilly/totlly nnotte Informtive group of genes or omins? Ex: COG tse Mny iffiulties! iology Wht re two similr

More information

COMP 250. Lecture 20. tree traversal. Oct. 25/26, 2017

COMP 250. Lecture 20. tree traversal. Oct. 25/26, 2017 COMP 250 Lecture 20 tree trversl Oct. 25/26, 2017 1 2 Tree Trversl How to visit (enumerte, iterte through, trverse ) ll the nodes of tree? 3 depthfirst (root){ // preorder if (root is not empty){ visit

More information

2. There are an infinite number of possible triangles, all similar, with three given angles whose sum is 180.

2. There are an infinite number of possible triangles, all similar, with three given angles whose sum is 180. SECTION 8-1 11 CHAPTER 8 Setion 8 1. There re n infinite numer of possile tringles, ll similr, with three given ngles whose sum is 180. 4. If two ngles α nd β of tringle re known, the third ngle n e found

More information

TOPIC: LINEAR ALGEBRA MATRICES

TOPIC: LINEAR ALGEBRA MATRICES Interntionl Blurete LECTUE NOTES for FUTHE MATHEMATICS Dr TOPIC: LINEA ALGEBA MATICES. DEFINITION OF A MATIX MATIX OPEATIONS.. THE DETEMINANT deta THE INVESE A -... SYSTEMS OF LINEA EQUATIONS. 8. THE AUGMENTED

More information

Trigonometry Revision Sheet Q5 of Paper 2

Trigonometry Revision Sheet Q5 of Paper 2 Trigonometry Revision Sheet Q of Pper The Bsis - The Trigonometry setion is ll out tringles. We will normlly e given some of the sides or ngles of tringle nd we use formule nd rules to find the others.

More information

CS 330 Formal Methods and Models

CS 330 Formal Methods and Models CS 330 Forml Methods nd Models Dn Richrds, George Mson University, Spring 2017 Quiz Solutions Quiz 1, Propositionl Logic Dte: Ferury 2 1. Prove ((( p q) q) p) is tutology () (3pts) y truth tle. p q p q

More information

Calculus Cheat Sheet. Integrals Definitions. where F( x ) is an anti-derivative of f ( x ). Fundamental Theorem of Calculus. dx = f x dx g x dx

Calculus Cheat Sheet. Integrals Definitions. where F( x ) is an anti-derivative of f ( x ). Fundamental Theorem of Calculus. dx = f x dx g x dx Clulus Chet Sheet Integrls Definitions Definite Integrl: Suppose f ( ) is ontinuous Anti-Derivtive : An nti-derivtive of f ( ) on [, ]. Divide [, ] into n suintervls of is funtion, F( ), suh tht F = f.

More information

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3

I1 = I2 I1 = I2 + I3 I1 + I2 = I3 + I4 I 3 2 The Prllel Circuit Electric Circuits: Figure 2- elow show ttery nd multiple resistors rrnged in prllel. Ech resistor receives portion of the current from the ttery sed on its resistnce. The split is

More information

Discrete Structures, Test 2 Monday, March 28, 2016 SOLUTIONS, VERSION α

Discrete Structures, Test 2 Monday, March 28, 2016 SOLUTIONS, VERSION α Disrete Strutures, Test 2 Mondy, Mrh 28, 2016 SOLUTIONS, VERSION α α 1. (18 pts) Short nswer. Put your nswer in the ox. No prtil redit. () Consider the reltion R on {,,, d with mtrix digrph of R.. Drw

More information

XML and Databases. Outline. 1. Top-Down Evaluation of Simple Paths. 1. Top-Down Evaluation of Simple Paths. 1. Top-Down Evaluation of Simple Paths

XML and Databases. Outline. 1. Top-Down Evaluation of Simple Paths. 1. Top-Down Evaluation of Simple Paths. 1. Top-Down Evaluation of Simple Paths Outline Leture Effiient XPth Evlution XML n Dtses. Top-Down Evlution of simple pths. Noe Sets only: Core XPth. Bottom-Up Evlution of Core XPth. Polynomil Time Evlution of Full XPth Sestin Mneth NICTA n

More information

Designing Information Devices and Systems I Spring 2018 Homework 7

Designing Information Devices and Systems I Spring 2018 Homework 7 EECS 16A Designing Informtion Devices nd Systems I Spring 2018 omework 7 This homework is due Mrch 12, 2018, t 23:59. Self-grdes re due Mrch 15, 2018, t 23:59. Sumission Formt Your homework sumission should

More information