Download as rtf, pdf, or txt
Download as rtf, pdf, or txt
You are on page 1of 7

CRT Technical By Naresh i

Technologies
Data Structures
1. What is data structure?
A data structure is a way of organizing data that considers not only
the ites stored! "ut also their relationshi# to each other. Ad$ance
%nowledge a"out the
relationshi# "etween data ites allows designing of efficient
algoriths for the
ani#ulation of data.
&. 'ist out the areas in which data structures are a##lied e(tensi$ely?
Co#iler Design!
)#erating Syste
Data"ase *anageent Syste
Statistical analysis #ac%age
Nuerical Analysis
+ra#hics
Artificial ,ntelligence
Siulation
-. What are the a.or data structures used in the following areas
/ RDB*S! Networ% data odel 0 1ierarchical data odel.
RDB*S 2 Array 3i.e. Array of structures4 Networ% data odel 2 +ra#h
1ierarchical data odel 2 Trees
5. ,f you are using C language to i#leent the heterogeneous lin%ed
list! what #ointer ty#e will you use?
The heterogeneous lin%ed list contains different data ty#es in its
nodes and we need a lin%! #ointer to connect the. ,t is not
#ossi"le to use ordinary #ointers for this. So we go for $oid #ointer.
6oid #ointer is ca#a"le of storing #ointer to any ty#e as it is a generic
#ointer ty#e.
7. *iniu nu"er of 8ueues needed to i#leent the #riority
8ueue?
Two. )ne 8ueue is used for actual storing of data and another for
storing #riorities.
9. What is the data structures used to #erfor recursion?
Stac%. Because of its ',:) 3'ast ,n :irst )ut4 #ro#erty it ree"ers
its ;caller< so %nows who to return when the function has to
return. Recursion a%es use of syste stac% for storing the
return addresses of the function calls.
=$ery recursi$e function has its e8ui$alent iterati$e
3non2recursi$e4 function.=$en when such e8ui$alent
iterati$e #rocedures are written! e(#licit stac% is to "e
used.
>. What are the notations used in =$aluation of Arithetic
=(#ressions using #refi( and #ostfi( fors?
?olish and Re$erse ?olish notations.
Data Structures ?age 1 of >
CRT Technical By Naresh i
Technologies
@. Con$ert the e(#ression 33A A B4 B C 2 3D 2 =4 C 3: A +44
to e8ui$alent ?refi( and ?ostfi( notations.
?refi( Notation/
C 2 B AABC 2 D= A :+
?ostfi( Notation/
AB A C B D= 2 2 :+ A C
D. Sorting is not #ossi"le "y using which of the following
ethods? 3a4 ,nsertion
3"4 Selection
3c4 =(change
3d4 Deletion
3d4 Deletion.
Esing insertion we can #erfor insertion sort! using selection
we can #erfor
selection sort! using e(change we can #erfor the "u""le
sort 3and other siilar sorting ethods4. But no sorting
ethod can "e done .ust using deletion.
1F. A "inary tree with &F nodes has null "ranches?
&1
'et us ta%e a tree with 7 nodes 3nG74
Data Structures ?age & of >
CRT Technical By Naresh i
Technologies
Null Branches
,t will ha$e only 9 3ie!7A14 null "ranches. ,n general! A
"inary tree with n nodes has e(actly nA1 null nodes.
11. What are the ethods a$aila"le in storing se8uential
Data Structures ?age - of >
CRT Technical By Naresh i
Technologies
files ?
Straight erging!
Natural erging!
?oly#hase sort!
Distri"ution of ,nitial runs.
1&. 1ow any different trees are #ossi"le with 1F nodes ?
1F15
:or e(a#le! consider a tree with -
nodes3nG-4! it will ha$e the a(iuco"ination
of 7 different 3ie! &- 2 - G 74 trees.
3a4 3"4 3c4 3d4
3e4
,n general/,f there are n nodes! there e(ist &n2n different
trees.
1-. 'ist out few of the A##lication of tree data2structure?
The ani#ulation of Arithetic e(#ression
Sy"ol Ta"le construction
Synta( analysis.
15. 'ist out few of the a##lications that a%e use of
*ultilin%ed Structures?
S#arse atri(
,nde( generation.
17. ,n tree construction which is the suita"le efficient data
structure? 3a4 Array 3"4 'in%ed list 3c4 Stac% 3d4 Hueue 3e4
none
3"4 'in%ed list
19. What is the ty#e of the algorith used in sol$ing the @
Hueens #ro"le?
Bac%trac%ing
1>. ,n an A6' tree! at what condition the "alancing is to "e
done?
,f the ;#i$otal $alue< 3or the ;1eight factor<4 is greater than
1 or less than 21.
1@. What is the "uc%et size! when the o$erla##ing and
collision occur at sae tie?
Data Structures ?age 5 of >
CRT Technical By Naresh i
Technologies
)ne. ,f there is only one entry #ossi"le in the "uc%et! when
the collision occurs!there is no way to accoodate the
colliding $alue. This results in the o$erla##ing of $alues.
&F. There are @! 17! 1-! 15 nodes were there in 5 different
trees. Which of the could ha$e fored a full "inary tree?
17.
,n general/
There are &n21 nodes in a full "inary tree.
By the ethod of eliination/
:ull "inary trees contain odd nu"er of nodes. So there
cannot "e full
"inary trees with @ or 15 nodes! so re.ected. With 1- nodes
you can for a co#lete
"inary tree "ut not a full "inary tree. So the correct answer
is 17.
Note/
:ull and Co#lete "inary trees are different. All full
"inary trees are co#lete "inary trees "ut not $ice $ersa.
&1. ,n the gi$en "inary tree! using array you can store the
node 5 at which location? At location 9
1 & - 2 2 5 2 2 7
Root 'C1 RC1 'C& RC& 'C- RC- 'C5 RC5
where 'Cn eans 'eft Child of node n and RCn eans Right
Child of node n
&&. Sort the gi$en $alues using Huic% Sort?
97 >F >7 @F @7 9F 77 7F 57
Sorting ta%es #lace fro the #i$ot $alue! which is the first
$alue of the gi$en
eleents! this is ar%ed "old. The $alues at the left
#ointer and right #ointer are indicated
using ' and R res#ecti$ely.
97 >F' >7 @F @7 9F 77 7F 57R
Since #i$ot is not yet changed the sae #rocess is continued
after interchanging the $alues at ' and R #ositions
97 57 >7 ' @F @7 9F 77 7F R >F
1
& -
5
7
97 57 7F @F ' @7 9F 77 R >7 >F
97 57 7F 77 @7 ' 9F R @F >7 >F
97 57 7F 77 9F R @7 ' @F >7 >F
When the ' and R #ointers cross each other the #i$ot $alue
is interchanged with the $alue at right #ointer. ,f the #i$ot
is changed it eans that the #i$ot has occu#ied its
original
#osition in the sorted order 3shown in "old italics4 and
hence two different arrays are
fored! one fro start of the original array to the #i$ot
Data Structures ?age 7 of >
CRT Technical By Naresh i
Technologies
#osition21 and the other fro #i$ot #ositionA1 to end.
9F ' 57 7F 77 R 97 @7 ' @F >7 >F R
77 ' 57 7F R 9F 97 >F R @F ' >7 @7
7F ' 57 R 77 9F 97 >F @F ' >7 R @7
,n the ne(t #ass we get the sorted for of the array. 57 7F
77 9F 97 >F >7 @F @7
&-. :or the gi$en gra#h! draw the D:S and B:S? The gi$en
gra#h/
B:S/ A I + 1 ? = * J K
D:S/ A I 1 ? = J * K +
&5. Classify the 1ashing :unctions "ased on the $arious
ethods "y which the %ey $alue is found.
Direct ethod
Su"traction ethod
*odulo2Di$ision ethod
Digit2=(traction ethod
*id2S8uare ethod
:olding ethod
?seudo2rando ethod.
&7. What are the ty#es of Collision Resolution Techni8ues
and the ethods used in each of the ty#e?
)#en addressing 3closed hashing4
The ethods used include/
)$erflow "loc%!
Closed addressing 3o#en hashing4
The ethods used include/
'in%ed list!
Binary treeL
&9. ,n RDB*S! what is the efficient data structure used in
the internal storage re#resentation?
BA tree. Because in BA tree! all the data is stored only in
leaf nodes! that a%es searching easier. This corres#onds
to the records that shall "e stored in leaf nodes.
&@. )f the following tree structure! which is! efficient
considering s#ace and tie co#le(ities?
3a4 ,nco#lete Binary Tree
3"4 Co#lete Binary Tree
3c4 :ull Binary Tree
3"4 Co#lete Binary Tree.
By the ethod of eliination/
:ull "inary tree loses its nature when o#erations of
insertions and deletions are done.
:or inco#lete "inary trees! e(tra storage is re8uired and
o$erhead of NE'' node chec%ing ta%es #lace.
So co#lete "inary tree is the "etter one since the #ro#erty
of co#lete "inary tree is aintained e$en after o#erations
li%e additions and deletions are done on it.
Data Structures ?age 9 of >
CRT Technical By Naresh i
Technologies
&D. What is a s#anning Tree?
A s#anning tree is a tree associated with a networ%. All the
nodes of the gra#h a##ear on the tree once. A iniu
s#anning tree is a s#anning tree organized so that the total
edge weight "etween nodes is iniized.
-F. Does the iniu s#anning tree of a gra#h gi$e the
shortest distance "etween any & s#ecified nodes?
No.
*inial s#anning tree assures that the total weight of the
tree is %e#t at its iniu. But it doesn<t ean that the
distance "etween any two nodes in$ol$ed in the iniu2
s#anning tree is iniu.
-&. Which is the si#lest file structure?
3a4 Se8uential
3"4 ,nde(ed
3c4 Rando
3a4 Se8uential
--. Whether 'in%ed 'ist is linear or Non2linear data structure?
According to Access strategies 'in%ed list is a linear one.
According to Storage 'in%ed 'ist is a Non2linear one.
-5. Draw a "inary Tree for the e(#ression
A B B 2 3C A D4 B 3? M H4
Data Structures ?age > of >

You might also like