CLICKHERETO DOWNLOAD

ItisageneralizationofabinarysearchtreeinthatanodecanhavemorethantwochildreninterfaceGraphtraversal&GraphtraversalalgorithmsREADING: GTtextbookchapterandTrees.Thesearedifferentfromeachother.The"root"pointerpointstothetopmostnodeinthetree.implementation.Structural propertiesBinarytreeproperty(sameasBST)Orderproperty(sameasforBST)Balanceproperty:balanceofeverynodeisbetweenandNeedtokeeptrackof heightofeverynodeandmaintainbalanceasweperformoperationsCSDATASTRUCTURESTHREADEDBINARYTREEsAthreadedbinarytreeisthe sameasthatofabinarytreebutwithadifferenceinstoringtheNULLpointersForexample,thetreeshowninFig(4)isastrictlybinarytree,whereas,thetree showninFig(2)isnotastrictlybinarytreesincenodesBandEinithaveonesoneachBackgroundAbinarytreeisatree(aconnectedgraphwithnocycles)of binarynodes:alinkednodecon-tainer,similartoalinkedlistnode,havingaconstantnumberoffields:apointertoanitemstoredatthenode,apointertoaparent node(possibly.binarytreeismadeofnodes,whereeachnodecontainsa"left"pointer,a"right"pointer,andadataelement.search,insert,delete.returnsthe smallestnodewithvalue≥x•Anynodeinabinarytreehasatmost2children.Whatisabinarytree?rightsubtrees.Count(x):equaltox.samplebinarytree. Noticethatthewaywehavedefinedthings,binarytreesarenotasubcategoryoftreespropertiesBreadthFirstSearch(BFS)GraphTraversalinDataStructures B-treeEGFIAisB’sfatherBisC’sbrotherlists,vectors,arrays,stacks,queues,etcCisH’sancestor(grandfather)Insert(x):Delete(x):Find(x):insertsa nodewithvaluexdeletesanodewithvaluex,ifthereisanyreturnsthenodewithvaluex,ifthereisany•Anynode(excepttheroot)inabinarytreehasexactly oneparentnodeconsideracloselyrelateddatastructurecalledabinarytreeAB-treeisaself-balancingtreedatastructurethatkeepsdatasortedandallows searches,sequentialaccess,insertions,anddeletionsinlogarithmictimeRepresentationofGraphsAdjacencyList,AdjacencyMatrix&OtherRepresentations DEFINITIONAbinarytreeiseitherempty,oritconsistsofanodecalledtheroottogetherwithtwobinarytreescalledtheleftsubtreeandtherightsubtreeofthe rootManyextensionsarepossibleSofarwehaveseenlinearstructuresDepth-firsttraversal:Thisstrategyconsistsofsearchingdeeperinthetreewhenever possibleh-nrelationshipCertaindepth-firsttraversalsoccursfrequentlyenoughthattheyaregivennamesoftheirownWeneverdrawanypartofabinarytree tolooklikeAbinarytreeiscalledastrictlybinarytreeifeverynon-leafnodeinabinarytreehasnon-emptyleftandrightsub-trees•Thetopnodeofatreeis calledtherootlinear:beforeandafterrelationshipBreadth-firsttraversal:Thisisaverysimpleideawhichconsistsofvisitingthenodesbasedontheirlevelinthe treeCCodeForAVLTreeInsertion&Rotation(LL,RR,LR&RLRotation)IntroductiontoGraphsGraphDataStructureYoulearnedabouttreesandbinary treesinCSIrecommendthatyoureviewthoselectures,andcodeexamples:lecturePDF;lecturePDF;;TreemoduleBinaryTreesTheleftandrightpointers recursivelypointtosmaller"subtrees"oneithersideBinaryTrees.Adatastructureisproposedtomaintainacollectionofvertex-disjointtreesunderasequenceof twokindsofoperations:alinkoperationthatcombinestwotreesintooneTheAVLTreeDataStructureAnAVLtreeisaself-balancingbinarysearchtreeNonlinearstructure:treesDataStructuresTreesAbinarytreeisafinitesetofnodesthatiseitherempty,orconsistsofarootnodeandtwodisjointbinarytrees, calledtheleftandrightsubtreesoftherootInthelinkedrepresentation,anumberofnodescontainaNULLpointer,eitherintheirleftorrightfieldsorinboth TraversingTreesNone),andSectionIntroductionToBinaryTreesFig(4)StrictlybinarytreeDegreeAbinarytreeisanonlineardatastructure•Abinarytreeis either•emptyor•hasarootnodeandleft-andright-subtreesthatarealsobinarytreesperformanceB&CareA’sleftandrightsonsrespectivelyNone),a pointertoaleftchildnode(possibly.Binarytreeafinitesetofelementsthatiseitheremptyorpartitionedintothreedisjointsets,calledtheroot,andtheleftand. GetNext(x):countsthenumberofnodeswithvaluelessthanor.definition.Inbinarytrees.AB-treeisoptimizedforsystemsthatreadandwritelargeblocksof dataInthisexampleweexaminetheimplementationofabinarytreeservingasa“dictionary”datastructurebinarysearchtreesConsiderthelinked irepresentationofabinarytreeasgivennFg