- What is Data Structure
- Binary Tree
- Data Structure
- C++ and DS
- B-Trees
- Un i q u e B i n a r y Search Tree R e p r e s e n t a t i o n s
- CPC - DS & Algo_4.pdf
- In
- Trees1x1
- Data Structure
- binarytree
- Algorithms Data Structures 01 Binary Search Tree
- Tree
- Trees 1
- Data structure Lab progrms
- B-trees, Shadowing, And Clones
- 141301 Data Structures
- j Treevisit PDF
- Particle Gibbs for Bayesian Additive Regression Trees
- lec5
- 10.1.1.26.1024
- lec8
- 091402109
- orgcard
- Semi Structured Textpdf
- Binary Frequency Search Algorithm
- CO 303 AAD Lec 2 Heapsort
- avl tree
- p340-yi
- Programming and Data Structure by NODIA
- Real 4
- Testing 4
- Testing 1
- Kirti Testing
- System Programing Solve 1
- System Software 3
- testing2 (1)
- Real 1 Solution
- rts 3
- system sw 4
- sp123
- Testing 2
- ritu
- s2
- RD3804A15
- It 4
- it 1 honrs
- Graphics 4
- It 1
- HW2_15
- Graphics 1
- java 2 (2)
- java HW 3
- D3804A15
- Java 4
- Java 1
- jiv testing2
- Graphics 8
- Graphics 4 (1)
- It 3

SUBMITTED TO- MR. SANJAY SOOD SUBMITTED BY-SURENDRA D3804A15 10806601

Part-A

1. for a binary tree T, the Pre-Order and In-Order traversal sequences are as Follows:Pre-Order: A B L M K N P Q In-Order: L B M A N K Q P

2. for a binary tree T, the Pre-Order and In-Order traversal sequences are as

Follows:Pre-Order: A B E H Q R C D K L M In-Order: B Q R H E A D L K M C (a) What is the height of the tree? (b) What are the internal nodes? (c) What is its Post-Order traversal sequence?

(a) The tree height is 5. (b)

(c) Post-Order traversal sequence:-

R QHEBLMKDCA 3. Suppose a binary tree is in memory:ROOT 14 1 2 3 4 5 6 7 8 9 1 0 1 1 1 2 1 3 1 4 1 5 1 6 1 7 1 8 Ans … INFO H R P B E C F Q S LEFT 4 0 17 0 18 3 1 6 0 15 0 0 0 A K L 5 2 0 13 D 0 0 9 0 0 RIGHT 11 0 0 7 0 10 16 12 0

4. Cons3ider the algebraic expression E= (2x + y) (5a – b)3 (a) Draw the tree T which corresponds to the expression E. (b)Find the Pre-Order of T. (A)..

(B).. ANS.

*+*2xy^-5ab3

Part-B

5. Illustrate the process of deletion in binary Search tree by considering suitable example. Ans..; Case a (info,left,right,root,loc,par) a. If left[loc]=null and right[loc]=null, then: Set child:=null Else if left[loc]!= left then Set child=left[loc] Else Set child=right[loc]

[end of structure] b. If par!=null then If loc=left[par] then Set left[par]=child Else Set right[par]=child [End of structure] Else Set root=child c. Return Case_b(info,left,right,root,loc,par) a. Find suc and parsuc • Set ptr=right[loc] and save=loc • Repeat while left[ptr]!=null o Set save=ptr and ptr=left[ptr] o End of loop • Set Suc=ptr and parsuc=save b. [delete inorder successor using procedure] • Call case_a(info,left,right,root,suc,parsuc) c. [replace node N by its inorder successor] • If par!=null then: o If loc=left[par] then o Set left[par]=suc Else o Set right[par]=suc End of if structure Else Set root=suc d. Set left[suc]=left[loc] and Right[suc]=right[loc] e. Return Del(info,left,pirht,root,avail,item) a. Call find(info,left,right,root,item,loc,par) b. If loc=null then write ITEM not in tree; and exit c. If right[loc]!=null and left[loc]!=null • Call case_ b Else • Case_ a

d. Set left[loc]=avail and avail=loc e. Exit.

6. Create a heap for following series: 11 Ans. 9 7 15 14 8 10 13

7. Illustrate the process of Insertion in binary Search tree by considering suitable example. Ans. EXAMPLE: - Suppose we have a binary search tree and suppose ITEM=20 is given. Then for insertion we follow the following process:-

1. Compare ITEM=20 with the root 34, of the tree T. Since 20<34, proceed to the left child of 36, which is 16. 2. Compare ITEM=20 with 16, since 20>16, proceed to the right child of 16, which is 28. 3. Compare ITEM =20 with 28, since 20< 28 proceed to the left of 28 which is 18. 4. Compare ITEM=20 with 17, since 20>17, and does not have a right child, insert 19 as the right child of 17.

- What is Data StructureUploaded bymeetsatyajee
- Binary TreeUploaded byAyush Gupta
- Data StructureUploaded bygnarvane
- C++ and DSUploaded byDrArpita Mathur
- B-TreesUploaded bySathish Kumar
- Un i q u e B i n a r y Search Tree R e p r e s e n t a t i o n sUploaded byΑλέξανδρος Γεωργίου
- CPC - DS & Algo_4.pdfUploaded byKousik Satish
- InUploaded byaniket84_pande
- Trees1x1Uploaded byshwetashetty1990
- Data StructureUploaded byPrerak Dedhia
- binarytreeUploaded byRAJENDRAN
- Algorithms Data Structures 01 Binary Search TreeUploaded bymurad
- TreeUploaded bysumit
- Trees 1Uploaded byDinesh Khandelwal
- Data structure Lab progrmsUploaded byjefrsn
- B-trees, Shadowing, And ClonesUploaded bymbenitezcol
- 141301 Data StructuresUploaded byDinesh Kumar
- j Treevisit PDFUploaded bysavio77
- Particle Gibbs for Bayesian Additive Regression TreesUploaded byKevin P
- lec5Uploaded byvphucvo
- 10.1.1.26.1024Uploaded byTanzin Thakur
- lec8Uploaded byPallav Anand
- 091402109Uploaded byArdi Barus
- orgcardUploaded bygk_scribd
- Semi Structured TextpdfUploaded byacsio
- Binary Frequency Search AlgorithmUploaded byLexid Pero Grisola
- CO 303 AAD Lec 2 HeapsortUploaded byPayal
- avl treeUploaded byVikash Kumar
- p340-yiUploaded byKlara Sess
- Programming and Data Structure by NODIAUploaded byJyoti Goswami

- Real 4Uploaded bySurendra Singh Chauhan
- Testing 4Uploaded bySurendra Singh Chauhan
- Testing 1Uploaded bySurendra Singh Chauhan
- Kirti TestingUploaded bySurendra Singh Chauhan
- System Programing Solve 1Uploaded bySurendra Singh Chauhan
- System Software 3Uploaded bySurendra Singh Chauhan
- testing2 (1)Uploaded bySurendra Singh Chauhan
- Real 1 SolutionUploaded bySurendra Singh Chauhan
- rts 3Uploaded bySurendra Singh Chauhan
- system sw 4Uploaded bySurendra Singh Chauhan
- sp123Uploaded bySurendra Singh Chauhan
- Testing 2Uploaded bySurendra Singh Chauhan
- rituUploaded bySurendra Singh Chauhan
- s2Uploaded bySurendra Singh Chauhan
- RD3804A15Uploaded bySurendra Singh Chauhan
- It 4Uploaded bySurendra Singh Chauhan
- it 1 honrsUploaded bySurendra Singh Chauhan
- Graphics 4Uploaded bySurendra Singh Chauhan
- It 1Uploaded bySurendra Singh Chauhan
- HW2_15Uploaded bySurendra Singh Chauhan
- Graphics 1Uploaded bySurendra Singh Chauhan
- java 2 (2)Uploaded bySurendra Singh Chauhan
- java HW 3Uploaded bySurendra Singh Chauhan
- D3804A15Uploaded bySurendra Singh Chauhan
- Java 4Uploaded bySurendra Singh Chauhan
- Java 1Uploaded bySurendra Singh Chauhan
- jiv testing2Uploaded bySurendra Singh Chauhan
- Graphics 8Uploaded bySurendra Singh Chauhan
- Graphics 4 (1)Uploaded bySurendra Singh Chauhan
- It 3Uploaded bySurendra Singh Chauhan