Lecture Note
ABPEI DBI Pre: * + AB+CD Pre: ABD EICFGJ in : A+B * C+D in : PBIEAFC4J * A. + + B C A B C D D E F G I J Pre:ABDGCE HIF Pre: ABDHIEJCFGKL in : DGBAHEICF in HDIBJEAFCLKG A. A B C B C D E F D E F G G H I H I J K L in : EACKEHDBG Pre : F & F A D E C H 5 C B
A B C. D E F 5 H I 4 ABDHIEJCFGKL pre HDIBJEAFCLKC in A B C D E F 5 H I J K L Pre: ABDEICIGJ in: DBIEAFC GJ A A B C D F 5 E J I &
\ ABDEICEGJ - Pre DBRIEAFCGJ -in A A. B C D I F G 2 I J Pre: * +AB+CD in A+B*C+D * * + + t A B C D A B C D 3 Pre : ABDGGEHIF in : DGBAHEICF B A B C D E 5 E I
Create BST from inorder and Preorder Troversal Inorder- DBEAFC Preorder- ABDEFC step from Preorder, Locate the root node i.e. A step 2: go to Inorder and divide list into left and right DBEAFC A left right for DBE DBE FC Step 3: again go to preorder. and locate next root proorder ABDEFC step 4 again go to the left Suptree and divide list in to left and right DBE A 1 rot lep right B for FC D E ie. F go to the proorder and locate next root FC A step 6 again divide free into left & right r FC B
construct a BST from postorder and inorder inorder 4.8.2,5.1,6.3.7 postorder 8.4.5.2,6.7.3,1 step 1. from postorder. locate the root i.e. last element 8.4,5.2,6.7.3.1 Step 2 go to inorder and divide the tree into left and right 48251637 rust left right Step 3: again go to postorder. and locate next/second last element i.e. 3 8,4,5,2,6,7.3. I step 4: for 6,3.7 go to inorder and divide free into left&nght 6,3,7 I 3 left root right 48,25 6 7 step 5: for 4825 again go to postorder traversal & find last element visited from 4,8,2,5 j.e. 2 it will be root step 6 go to inarder, and divide free into left light 1 4.8.25 left root right 3 2 4.8. 6 7
step 7 : again go to postorder & find last element visited from 4.8 je 4. H will be root step 8. go to inorder & divide tree into left & right 4,8 root right I 2 3 4 6 7 8
Sequential Steps and Operations in ASDET Process
Please or to post comments