Binary search tree bst, Data Structure & Algorithms

Describe Binary Search Tree (BST)? Make a BST for the given sequence of numbers.

45, 36, 76, 23, 89, 115, 98, 39, 41, 56, 69, 48

Traverse the obtained tree in Preorder, Inorder and postorder.

A binary search tree B is a binary tree whose each node satisfies the following conditions:

1.  The value obtained of the left-subtree of 'x' is less than the value at 'x'

2.  The value obtained of the right-subtree of 'x' is greater than value at 'x'

3.  The left-subtree and right-subtree of the binary search tree are again binary search tree.

2274_Binary_Search_Tree_BST.png

Preorder:-                                                                                     

23, 36, 39, 41, 45, 48, 56, 69, 76, 89, 98, 115

Inorder:-

45, 36, 23, 39, 41, 76, 56, 48, 69, 89, 115, 98

Postorder:-

23, 41, 39, 36, 48, 69, 56, 98, 115, 89, 76

 

Posted Date: 7/9/2012 10:19:52 PM | Location : United States







Related Discussions:- Binary search tree bst, Assignment Help, Ask Question on Binary search tree bst, Get Answer, Expert's Help, Binary search tree bst Discussions

Write discussion on Binary search tree bst
Your posts are moderated
Related Questions
Regis lives in Brazil and frequently travels to USA, Japan and Europe. He wants to be able to convert Brazilian Reais into US dollars, European euros and Japanese yen. Conversion f

Board coloring , C/C++ Programming

HOW LINKED LIST HEADER WORKS? HOW TO INSERT AND DELETE ELEMENTS IN LINKED LIST?

Typical programming languages such as Pascal, C or Java give primitive data kinds such as integers, boolean, reals values and strings. They give these to be organised into arrays,


what do you understand by structured programming?explain with eg. top down and bottem up programming technique

Q. Construct a complete binary tree with depth 3 for this tree which is maintained in the memory using the linked representation. Make the adjacency list and adjacency matrix for t

In the amortized analysis, the time needed to perform a set of operations is the average of all operations performed. Amortized analysis considers as a long sequence of operations

We might sometimes seek a tradeoff among space & time complexity. For instance, we may have to select a data structure which requires a lot of storage to reduce the computation tim

A binary search tree is used to locate the number 43. Which of the following probe sequences are possible and which are not? Explain. (a) 61 52 14 17 40 43 (b) 2 3 50 40 60 43 (c)