Vous êtes sur la page 1sur 6

# 1.Whatisdatastructure?

Ans:Thelogicalandmathematicalmodelofaparticularorganizationofdataiscalleddata
structure.Therearetwotypesofdatastructure
i)Linear
ii)Nonlinear
2.WhatarethegoalsofDataStructure?
Ans:Itmustrichenoughinstructuretoreflecttheactualrelationshipofdatainrealworld.
Thestructureshouldbesimpleenoughforefficientprocessingofdata.
3.WhatdoesabstractDataTypeMean?
Ans:Datatypeisacollectionofvaluesandasetofoperationsonthesevalues.Abstractdata
typerefertothemathematicalconceptthatdefinethedatatype.
1)Valuesdefinition
2)Operationdefinition
oftwointegers,seconddoesntequaltozero.
4.WhatisthedifferencebetweenaStackandanArray?
Ans:
i)Stackisaorderedcollectionofitems
iii)Stackmaycontaindifferentdatatypes
iv)Stackisdeclaredasastructurecontaininganarraytoholdtheelementofthestack,andan
integertoindicatethecurrentstacktopwithinthearray.
ARRAY
i)Arrayisanorderedcollectionofitems
ii)Arrayisastaticobjecti.e.noofitemisfixedandisassignedbythedeclarationofthearray
iii)Itcontainssamedatatypes.
iv)Arraycanbehomeofastacki.e.arraycanbedeclaredlargeenoughformaximumsizeofthe
stack.
5.Whatdoyoumeanbyrecursivedefinition?
Ans:T
hedefinitionwhichdefinesanobjectintermsofsimplercasesofitselfiscalledrecursive
definition.
6.Whatissequentialsearch?
Ans:Insequentialsearcheachiteminthearrayiscomparedwiththeitembeingsearcheduntila
7.Whatactionsareperformedwhenafunctioniscalled?
Ans:Whenafunctioniscalled
i)argumentsarepassed
ii)localvariablesareallocatedandinitialized

ii)transferringcontroltothefunction
8.Whatactionsareperformedwhenafunctionreturns?
Ans:
ii)Functionsdataareaisfreed
givenbypointers.Eachnodehastwopartsfirstpartcontaintheinformationoftheelement
Ans:
ii)Onecantdoubleortriplethesizeofarrayasitoccupiesblockofmemoryspace.
nextelement
12.Whatdoyoumeanbyfreepool?
13.Whatdoyoumeanbygarbagecollection?
14.Whatdoyoumeanbyoverflowandunderflow?
16.Whatisaqueue?
17.Whatisapriorityqueue?
20.Whatisdanglingpointerandhowtoavoidit?
Ans:
i)Wecannotreachanyofthenodesthatprecedenode(p)
ii)Ifalististraversed,theexternalpointertothelistmustbeperseveredinordertoreferencethelist
again

22.Definecircularlist?
Ans:Inlinearlistthenextfieldofthelastnodecontainanullpointer,whenanextfieldinthe
lastnodecontainapointerbacktothefirstnodeitiscalledcircularlist.
Ans:
i)Wecanttraversethelistbackward

ii)Ifapointertoanodeisgivenwecannotdeletethenode
Ans:Itisacollectionofdataelementscallednodes,whereeachnodeisdividedintothreeparts
i)Aninfofieldthatcontainstheinformationstoredinthenode
ii)Leftfieldthatcontainpointertonodeonleftside
iii)Rightfieldthatcontainpointertonodeonrightside
25.Isitnecessarytosortafilebeforesearchingaparticularitem?
Ans:
Iflessworkisinvolvedinsearchingaelementthantosortandthenextract,thenwedontgofor
sort
Iffrequentuseofthefileisrequiredforthepurposeofretrievingspecificelement,itismore
efficienttosortthefile.
Thusitdependsonsituation.
26.Whataretheissuesthathampertheefficiencyinsortingafile?
Ans:Theissuesare
i)Lengthoftimerequiredbytheprogrammerincodingaparticularsortingprogram
ii)Amountofmachinetimenecessaryforrunningtheparticularprogram
iii)Theamountofspacenecessaryfortheparticularprogram.
27.Calculatetheefficiencyofsequentialsearch?
Ans:Thenumberofcomparisonsdependsonwheretherecordwiththeargumentkeyappearsin
thetable
Ifitappearsatfirstpositionthenonecomparison
Ifitappearsatlastpositionthenncomparisons
Average=(n+1)/2comparisons
Unsuccessfulsearchncomparisons
NumberofcomparisonsinanycaseisO(n).
28.Isanyimplicitargumentsarepassedtoafunctionwhenitiscalled?
Ans:Yesthereisasetofimplicitargumentsthatcontaininformationnecessaryforthefunction
functionbranchestothatlocation.
29.ParenthesisisneverrequiredinPostfixorPrefixexpressions,why?
Ans:Parenthesisisnotrequiredbecausetheorderoftheoperatorsinthepostfix/prefix
expressionsdeterminestheactualorderofoperationsinevaluatingtheexpression
30.Listouttheareasinwhichdatastructuresareappliedextensively?
Ans:
CompilerDesign,
OperatingSystem,
DatabaseManagementSystem,
Statisticalanalysispackage,
NumericalAnalysis,
Graphics,

ArtificialIntelligence,
Simulation

31.Whatarethemajordatastructuresusedinthefollowingareas:networkdatamodel&
Hierarchicaldatamodel.
Ans:
RDBMSArray(i.e.Arrayofstructures)
NetworkdatamodelGraph
HierarchicaldatamodelTrees
typewillyouuse?
pointertoconnectthem.Itisnotpossibletouseordinarypointersforthis.Sowegoforvoid
pointer.Voidpointeriscapableofstoringpointertoanytypeasitisagenericpointertype.
33.Minimumnumberofqueuesneededtoimplementthepriorityqueue?
Ans:Two.Onequeueisusedforactualstoringofdataandanotherforstoringpriorities.
34.Whatisthedatastructuresusedtoperformrecursion?
Ans:Stack.BecauseofitsLIFO(LastInFirstOut)propertyitremembersitscallersoknows
whomtoreturnwhenthefunctionhastoreturn.Recursionmakesuseofsystemstackforstoring
Everyrecursivefunctionhasitsequivalentiterative(nonrecursive)function.Evenwhensuch
equivalentiterativeproceduresarewritten,explicitstackistobeused.
35.WhatarethenotationsusedinEvaluationofArithmeticExpressionsusingprefixand
postfixforms?
Ans:PolishandReversePolishnotations.
36.Converttheexpression((A+B)*C(DE)^(F+G))toequivalentPrefixand
Postfixnotations.
Ans:PrefixNotation:
^*+ABCDE+FG
PostfixNotation:
AB+C*DEFG+^

37.Sortingisnotpossiblebyusingwhichofthefollowingmethods?
(a)Insertion
(b)Selection
(c)Exchange
(d)Deletion
Ans:(d)Deletion.
Usinginsertionwecanperforminsertionsort,usingselectionwecanperformselectionsort,
usingexchangewecanperformthebubblesort(andothersimilarsortingmethods).Butno
sortingmethodcanbedonejustusingdeletion.
38.ListoutfewoftheApplicationoftreedatastructure?

Ans:
ThemanipulationofArithmeticexpression,
SymbolTableconstruction,
Syntaxanalysis.
Ans:Sparsematrix,Indexgeneration.
40.intreeconstructionwhichisthesuitableefficientdatastructure?

41.Whatisthetypeofthealgorithmusedinsolvingthe8Queensproblem?
Ans:Backtracking
42.InanAVLtree,atwhatconditionthebalancingistobedone?
Ans:Ifthepivotalvalue(ortheHeightfactor)isgreaterthan1orlessthan1.
43.Thereare8,15,13,14nodesweretherein4differenttrees.Whichofthemcouldhave
formedafullbinarytree?
Ans:15
Ingeneral:
Thereare2n1nodesinafullbinarytree.
Bythemethodofelimination:
Fullbinarytreescontainoddnumberofnodes.Sotherecannotbefullbinarytreeswith8or14
nodes,sorejected.With13nodesyoucanformacompletebinarytreebutnotafullbinarytree.
Note:FullandCompletebinarytreesaredifferent.Allfullbinarytreesarecompletebinarytrees
butnotviceversa.
44.InRDBMS,whatistheefficientdatastructureusedintheinternalstorage
representation?
Ans:B+tree.BecauseinB+tree,allthedataisstoredonlyinleafnodes,thatmakessearching
easier.Thiscorrespondstotherecordsthatshall
bestoredinleafnodes.
45.Oneofthefollowingtreestructures,whichis,efficientconsideringspaceandtime
complexities?
a)IncompleteBinaryTree.
b)CompleteBinaryTree.
c)FullBinaryTree.
Ans:
b)CompleteBinaryTree.
Bythemethodofelimination:
Fullbinarytreelosesitsnaturewhenoperationsofinsertionsanddeletionsaredone.For
incompletebinarytrees,
deletionsaredoneonit.

46.WhatisaspanningTree?
Ans:Aspanningtreeisatreeassociatedwithanetwork.Allthenodesofthegraphappearon
thetreeonce.Aminimumspanningtreeisaspanningtreeorganizedsothatthetotaledgeweight
betweennodesisminimized.
47.Doestheminimumspanningtreeofagraphgivetheshortestdistancebetweenany2
specifiednodes?
Ans:No.
Minimalspanningtreeassuresthatthetotalweightofthetreeiskeptatitsminimum.Butit
doesntmeanthatthedistancebetweenanytwonodesinvolvedintheminimumspanningtreeis
minimum.