0% found this document useful (0 votes)
37 views

Data Structures

data structures

Uploaded by

Savya Mittal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Data Structures

data structures

Uploaded by

Savya Mittal
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 6

Data Structures HCL 1.

What data structes you will use if you want to go to first record from the last and vice versa? ans.: doubly lin ed circular list !. given a height balanced tree. "f we add one more node # how many nodes gets unbalanced ? $ns. % %. &iven a arbitrary 'ointer to an element in a singly lin ed list? what is the time com'le(ity for its deletion . $ns. )*n+ ,. S-.S/S0 s-.s1s0 s-.a how many 'arse trees 'ossible : a/a1a/a $ns. 2 2. order of Hashing time 3+ $ choclate of si4e n5n is given and is to be made into 'ices of si4e 1(1. $t a time both hori4ontal and a vertical cut is done. 6ind the order of com'le(ity a+ 7*n!+ b+ o*nlogn+ c+ o*logn+ $ns : a 8+ com'arison between hashtable and binary tree HUGHES 9+ :o. of nodes of degree ! in a binary tree with n leaf nodes. $ns. n-1 ;. <o sorting array of 17 elements which sorting is best a+slection b+bubble c+tree sort d+.... ans:a 17 <o saving s'ace 'oint of view which sort is best a+selection b+insertion c+both a = b d+... 11Which statement is wrong on hea' a+$ny two childs should not same

b+.. c+.. d+... ans:a 1!+ cyclometric com'le(ity.. 1%+ how many null 'ointer are there in : number binary tree ans::/1 1,+ <wo sorted list of si4e n what are the ma(imum com'arison in merge $:s:!n-1 12+ two sorted lists of n elements will ta e at least fine the order of com'le(ity? a. !n b. n>! c. s?uare*n+ 13+if there are n nodes in a binary tree# how many null 'ointers are there ans:n/10 18+. if hea' sort contains n elements# no of com'arsions re?uired are a. log*n+ b. height of hea' sort c. d. 19+ which of the following is efficient in terms of s'ace a. insertion sort b. ?uic sort c. selection d. both a and c 1;+ in sorted table contains elements # which of the searching is false a. hash table b. binary searching !7+ in associated memory for fast accessing which one is used a. single lin ed list b. double @ c. hash table

!1+ for hashing which is best on terms of buc ets a+177 b+27 c+!1 d+%! ans %! !!+ ma( and avg. height of sorted binary tree a. logn n b n logn !%+ im'lementation of 'riority ?ueue a. tree b lin ed list c doubly lin ed list !,+ 6or a binary tree with n nodes# How many nodes are there which has got both a 'arent and a child? !2+ Aubble sort : &iven se?uence of numbers what will be order of se?uences after two iterations. $ns: very trivial# but you should now what bubble sort does. !3+Aubble sort : how many swa' o'erations has been done in the above 'rocess? !8+What data structures you should use for dictionary searching and it should be ca'able of doing s'ell chec also ? $ns: Hashing !9+Which is the best scheduling algo. *given five of them+ $ns.: Shortest Bob 6irst with Cre-em'tion !;+ Aubble sort is given .# :o of times it e(ecutes ans . n*n-1+>! %7+ <he a''ri(imate ratio for no of internal nodes to total no %1+ 'recedence order from high to low * * + // > + %!+ 'reorder of $1*A/C+>D-& *1/$AC>-D&+ %%+ A-tree *failure nodes at same level+ of nodes in -ary tree of de'th n. ans. 1> %,+ merge sort time com'le(ity * )*n log n+ + %2+ while following sorting algorithem has average sorting behavior *hea'

sort + %3+in binary search tree which traversal is used for getting ascending order values *inorder + %8+ fun*n+ D if*nEF!+ return *1+0 else return **fun*n-1+1fun*n-!++0 G find the order of com'le(ity of the 'rogramme. 'ossible answer ---- :*!Hn+ %9+. average and worst time com'le(ity in a sorted binary tree is %;+ a tree is given and as to find its meaning *'arse-tree+ *e('ression tree+ ans. **a/b+-*c1d++ * not confirmed+ ,7+ Com'ute the com'le(ity of Ainary search. $ns : )*lg n+ * $nswer in detail. <his is not a multi'le choice ?uestion. "t carries more mar s.+ ,1+ $ search 'rocedure which assosiates an address with a ey value and 'rovides a mechanism for dealing with two or more values assigned to the same address to the same address is called. a+ linear earch b+ binary search 1 c+ hash coded search d+ radi( search ,!+which data struture is needed to convert infi( notations to 'ostfi( notations? a. linear list b. ?ueue c. tree d. stac ans:d ,%+ recursive 'rocedures are im'lemented by a.?ueues b.stac s c.lin ed lists d.strings

,,+ $ linear list of elments in which deletion can be done from one end *front+and insertion can ta e 'lace only at the other end*rear+is nown as 1a+ ?ueues b+stac s c+trees d+de?ue ,2+ $ linear list in which elements can be added or removed at either end but not in the middle is nown as a+?ueue 1b+de?ue c+stac d+tree ,3+which of the following sorting 'rocedure is slowest a+?uic sort b+hea' sort c+shell sort 1d+bubble sort ,8+ <he com'le(ity of bublle sort is7*a+#then e?uals ans:! ,9+ given a height balanced tree. "f we add one more node # how many nodes gets unbalanced ? $ns. % ,;+ &iven a arbitrary 'ointer to an element in a singly lin ed list? what is the time com'le(ity for its deletion . $ns. )*n+ 27+ S-.S/S0 s-.s1s0 s-.a how many 'arse trees 'ossible : a/a1a/a $ns. 2 21+ order of Hashing time 2!+ $ choclate of si4e n5n is given and is to be made into 'ices of si4e 1(1. $t a time both hori4ontal and a vertical cut is done. 6ind the order of com'le(ity a+ 7*n!+ b+ o*nlogn+ c+ o*logn+ $ns : a 2%+ com'arison between hashtable and binary tree

You might also like