Vous êtes sur la page 1sur 6

Search...

HOME
PROJECTS

OBJECTIVE C

DATA STRUCTURE

SQLITE

C INTERVIEW QUESTIONS

C++ INTERVIEW QUESTIONS

TECH NEWS

Data Structures Interview Questions-Trees


GoogleWebHosting
Acti9DistributionBoard
ManipalUniversity(MU)

SUBSCRIBE VIA EMAIL


Name

Email*

Subscribe

ADVERTISEMENTS

StartDownload
fromdoctopdf.com

ConvertAnyFiletoaPDF.GettheFreeFrom
DoctoPdfApp!

DataStructuresInterview
QuestionsTrees
1.TheheightofaBSTisgivenash.Considertheheightofthetreeastheno.ofedgesinthe
longestpathfromroottotheleaf.Themaximumno.ofnodespossibleinthetreeis?
a)2h11b)2h+11c)2h+1d)2h1+1
2.Thenoofexternalnodesinafullbinarytreewithninternalnodesis?
a)nb)n+1c)2nd)2n+1
3.Thedifferencebetweentheexternalpathlengthandtheinternalpathlengthofabinary
treewithninternalnodesis?
a)1b)nc)n+1d)2n
4.Supposeabinarytreeisconstructedwithnnodes,suchthateachnodehasexactlyeither
zeroortwochildren.Themaximumheightofthetreewillbe?
a)(n+1)/2b)(n1)/2c)n/21d)(n+1)/21
5.WhichofthefollowingstatementaboutbinarytreeisCORRECT?
a)Everybinarytreeiseithercompleteorfull
b)Everycompletebinarytreeisalsoafullbinarytree
c)Everyfullbinarytreeisalsoacompletebinarytree
d)Abinarytreecannotbebothcompleteandfull
6.Supposewehavenumbersbetween1and1000inabinarysearchtreeandwanttosearch
forthenumber363.Whichofthefollowingsequencecouldnotbethesequenceofthenode
examined?
a)2,252,401,398,330,344,397,363
b)924,220,911,244,898,258,362,363
c)925,202,911,240,912,245,258,363
d)2,399,387,219,266,382,381,278,363
7.Infullbinarysearchtreeeveryinternalnodehasexactlytwochildren.Ifthereare100leaf

LATEST JOBS UPDATES

C SOFTWARES

nodesinthetree,howmanyinternalnodesarethereinthetree?
a)25b)49c)99d)101

Balututorials
3,267likes

8.Whichtypeoftraversalofbinarysearchtreeoutputsthevalueinsortedorder?
a)Preorderb)Inorderc)Postorderd)None
LikePage

DataStructuresInterviewQuestionsTrees

Share

Bethefirstofyourfriendstolikethis

9.Supposeacompletebinarytreehasheighth>0.Theminimumnoofleafnodespossiblein
termofhis?
a)2h1b)2h1+1c)2h1d)2h+1
10.A23isatreesuchthat
a)Allinternalnodeshaveeither2or3children
b)Allpathfromroottoleaveshavethesamelength.Thenumberofinternalnodesof
a23treehaving9leavescouldbe
a)4b)5c)6d)7
11.Ifanodehavingtwochildrenistobedeletedfrombinarysearchtree,itisreplacedbyits
a)Inorderpredecessorb)Inordersuccessorc)Preorderpredecessord)None
12.Abinarysearchtreeisformedfromthesequence6,9,1,2,7,14,12,3,8,18.The
minimumnumberofnodesrequiredtobeaddedintothistreetoformanextendedbinarytree
is?

RECENT POSTS
C++PlacementQuestionsandAnswers
CPPInterviewQuestionsandAnswers
C++InterviewQuestionsandAnswersFor
Freshers
DataStructuresInterviewQuestionsTrees
DataStructuresInterviewQuestionsQueue
DataStructuresInterviewQuestionsStacks
DataStructuresInterviewQuestionsSorting
DataStructuresInterviewQuestionsLinkedList
DataStructuresInterviewQuestionsPlacement
paper
DataStructuresInterviewQuestions

a)3b)6c)8d)11
13.Inafullbinarytree,everyinternalnodehasexactlytwochildren.Afullbinarytreewith
2n+1nodescontains
a)nleafnodeb)ninternalnodesc)n1leafnodesd)n1internalnodes
14.theruntimefortraversingallthenodesofabinarysearchtreewithnnodesandprinting
theminanorderis
a)O(nlg(n))b)O(n)c)O(n)d)O(log(n))

LiveTrafficFeed
AvisitorfromDelhiviewed
"BALUTUTORIALSDestinationTowards
KnowledgeandSuccess"1minago
AvisitorfromBergen,Hordalandviewed"C
PlacementPaperCDAC"5minsago
AvisitorfromSanFrancisco,Californiaviewed
"basicc++interviewquestionsandanswersfor
fresherspdffreedownloadArchives
BALUTUTORIALS"19minsago
AvisitorfromBoston,Massachusettsviewed
"C++PlacementQuestionsandAnswers
BALUTUTORIALS"21minsago
AvisitorfromMountainView,California
viewed"IntegrateSQLiteSourceCodewith
DevC++Project"34minsago
AvisitorfromBangalore,Karnatakaviewed
"basicc++interviewquestionsandanswersfor
fresherspdffreedownloadArchives
BALUTUTORIALS"47minsago
AvisitorfromMountainView,California

15.Whenabinarytreeisconvertedintoanextendedbinarytree,allthenodesofabinary
treeintheexternalnodebecomes
a)Internalnodesb)Externalnodesc)Rootnodesd)None
16.IfnnumbersaretobesortedinascendingorderinO(nlogn)time,whichofthefollowing
treecanbeused
a)Binarytreeb)Binarysearchtreec)Maxheapd)Minheap

DataStructuresInterviewQuestions
Trees
17.Ifnelementsaresortedinabinarysearchtree.Whatwouldbetheasymptoticcomplexity
tosearchakeyinthetree?
a)O(1)b)O(logn)c)O(n)d)O(nlogn)

viewed"ArrayAptitudeQuestionsinCwith
AnswersBALUTUTORIALS"1hr5mins
AvisitorfromUnitedStatesviewed"Lenevo
ago
A600PlusSpecificationsAndPriceInIndia
BALUTUTORIALS"1hr8minsago
AvisitorfromHyderabad,AndhraPradesh
viewed"AboutUsBALUTUTORIALS"1hr
59minsago
AvisitorfromBangalore,Karnatakaviewed
"MiniProjectEmployeeRecordManagement
SystemUsingC"2hrs6minsago
RealtimeviewGetFeedjit

18.Ifnelementsaresortedinabalancedbinarysearchtree.Whatwouldbetheasymptotic
complexitytosearchakeyinthetree?
a)O(1)b)O(logn)c)O(n)d)O(nlogn)
19.Theminimumnumberofelementsinaheapofheighthis
a)2h+1b)2hc)2h1d)2h1
20.Themaximumnumberofelementsinaheapofheighthis
a)2h+11b)2hc)2h1d)2h1
21.Athreadedbinarytreeisabinarytreeinwhicheverynodethatdoesnothaverightchild
hasathreadtoits
a)Preordersuccessorb)Inordersuccessorc)Inorderpredecessord)Postorder
successor
22.Inwhichofthefollowingtree,parentnodehasakeyvaluegreaterthanorequaltothe
keyvalueofbothofitschildren?
a)Binarysearchtreeb)Threadedbinarytreec)Completebinarytreed)Maxheap
23.AbinarytreeThasnleafnodes.Thenumberofnodesofdegree2inTis
a)log2nb)n1c)nd)2n
24.Abinarysearchtreeisgeneratedbyinsertinginorderthefollowingintegers:
50,15,62,5,20,58,91,3,8,37,60,24Thenumberofthenodeintheleftsubtreeandright
subtreeoftheroot,respectively,is
a)(4,7)b)(7,4)c)(8,3)d)(3,8)

24x7ElderCareat
Home
MedicallyTrained,Certified
NursesBookHomeVisit.
ContactNow!

Tweet

Like

Previous:

DataStructuresInterviewQuestions
Queue

StumbleUpon

Next:

C++InterviewQuestionsandAnswers
ForFreshers

ABOUT BALU NAIK

RELATED ARTICLES

DataStructuresInterview
QuestionsQueue

DataStructuresInterview
QuestionsStacks

DataStructuresInterview
QuestionsLinkedList

June24,2015

May31,2015

May31,2015

DataStructuresInterview
QuestionsPlacementpaper

DataStructuresInterview
Questions

May31,2015

May30,2015

LEAVE A REPLY
Youremailaddresswillnotbepublished.Requiredfieldsaremarked*
Name*

Email*

Website

PostComment

Copyright2015.AllRightsReserved.Balututorials

Vous aimerez peut-être aussi