Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Binary Search tree , In order, pre order, post order trave , Summaries of Design

this content contains excersises about how creating binary search tree and the traverse tree (in order, post order, pre order traverse)

Typology: Summaries

2023/2024

Uploaded on 04/30/2024

doaa-hany-1
doaa-hany-1 🇪🇬

1 / 3

Toggle sidebar

Related documents


Partial preview of the text

Download Binary Search tree , In order, pre order, post order trave and more Summaries Design in PDF only on Docsity! Binary search tree exercises: 1. Show the binary search tree that would be formed by inserting the following keys in the order shown: 29, 17, 8, 48, 26, 19, 1, 34, 40,50,33,10,5 2. Show the binary search tree that would be formed by inserting the following keys in the order shown: 7, 4, 12, 3, 6, 8, 1, 5, 10 Determined In-Order traversal, Pre-Order Traversal, Post-Order Traversal. 3. Determined In-Order traversal, Pre-Order Traversal, Post-Order Traversal. 4. Determined In-Order traversal, Pre-Order Traversal, Post-Order Traversal for following tree: 5. Choose the correct answer: 1. Suppose the numbers 7, 5, 1, 8, 3, 6, 0, 9, 4, 2 are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the in-order traversal sequence of the resultant tree? a) 7 5 1 0 3 2 4 6 8 9 b) 0 2 4 3 1 6 5 9 8 7 c) 0 1 2 3 4 5 6 7 8 9 d) 9 8 6 4 2 3 0 1 5 7 2. The following numbers are inserted into an empty binary search tree in the given order: 10, 1, 3, 5, 15, 12, 16. What is the height of the binary search tree (the height is the maximum distance of a leaf node from the root(the largest number of edges))? a) 2 b) 3 c) 4 d) 6 First Draw BST:
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved