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
what algorithms can i use for the above title in my project desing and implmentation of road transport booking system

What are the Objectives of visual realism applications After studying this unit, you should be able to know specific needs of realism, add realism to pictures by el


What are circular queues?  Circular queue: Static queues have a very large drawback that once the queue is FULL, even though we erase few elements from the "front" and relieve

Definition of Algorithm Algorithm must have the following five characteristic features: 1.      Input 2.      Output 3.      Definiteness 4.      Effectiveness 5

Graphs are data structures which consist of a set of vertices & a set of edges which connect the vertices. A graph where the edges are directed is called directed graph. Or else, i

How can we convert a graph into a tree ? Do we have any standardized algorithm for doing this?

perform the following length operation LENGTH("welcome to ICA")=

This algorithm inputs 5 values and outputs how many input numbers were positive and how many were negative. Data to be used: N = 1, -5, 2, -8, -7

Q. Write  down a   programme  in  C  to  create  a  single  linked  list also  write the functions to do the following operations (i)  To insert a new node at the end (ii