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
This unit discussed about data structure called Arrays. The easiest form of array is a one-dimensional array which may be described as a finite ordered set of homogeneous elements

Thread By changing the NULL lines in a binary tree to special links known as threads, it is possible to perform traversal, insertion and deletion without using either a stack

Q. Write down an algorithm to insert a node in between any two nodes in a linked list         Ans. Insertion of a the node after the given element of the listis as follows

Q. Assume that we have separated n elements in to m sorted lists. Explain how to generate a single sorted list of all n elements in time O (n log m )?


I am looking for some help with a data mining class with questions that are about neural networks and decision trees. Can you help? I can send document with questions.

representation of links list in memory

Z-Buffer Algorithm Also known as the Depth-Buffer algorithm, this image-space method simply selects for  display the polygon or portion of a polygon that is nearest to the view

In this unit, we have learned how the stacks are implemented using arrays and using liked list. Also, the advantages and disadvantages of using these two schemes were discussed. Fo

Assertions and Abstract Data Types Even though we have defined assertions in terms of programs, notion can be extended to abstract data types (which are mathematical entities).