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
Q. Explain Dijkstra's algorithm for finding the shortest path in the graph given to us.  Ans: The Dijkstra's algorithm: This is a problem which is concerned with finding


It does not have any cycles (circuits, or closed paths), which would imply the existence of more than one path among two nodes. It is the most general kind of tree, and might be co

The data structure needed for Breadth First Traversal on a graph is Queue

give some examples of least cost branch and bound method..

#questWrite an algorithm for multiplication of two sparse matrices using Linked Lists.ion..

The best average behaviour is shown by  Quick Sort

Example of pre order traversal: Reading of a book, since we do not read next chapter unless we complete all sections of previous chapter & all its sections. Figure  : Rea

Define Minimum Spanning Tree A minimum spanning tree of a weighted linked graph is its spanning tree of the smallest weight, where the weight of a tree is explained as the sum

design algorithm and flow chart that computes the absolute difference of two values x and y