Binary Search Tree and Traversals
It is a binary tree with the property that the value in a node is greater than any value in a node's left sub-tree and less than any value in the node's right sub-tree.
The Operations on Binary Search Tree are:
init (T) |
creates an empty Binary search tree by initializing T to NULL |
insert (T, x) |
inserts the value x in the proper position in the Binary search tree |
search (T, x) |
searches if the value x is present in the search tree |
inorder (T) |
displays the node using inorder traversal of binary search tree |
postorder (T) |
displays the node using postorder traversal of binary search tree |
preorder (T) |
displays the node using preorder traversal of binary search tree |
delete(T, x) |
Deletes node x from binary search tree |
Set A
Set B
Set C
a) Write a C program which uses Binary search tree library and implements following two functions:
0 Comments:
Post a Comment