CSCI 2320 Data Structure Project 2Construct Binary Search Tree by Array Executive Summary:A binary search tree is a binary tree in which every node satisfies the following:- the key of every node in the left subtree is smaller than the key of this node- the key of every node in the right subtree is larger than the key of this nodeIt is possible to construct BST without using pointers. A single dimension array is goodenough to construct a BST. One example is like following:For any node, to find its parent’s index:If the node’s index is even number --- index/2If the node’s index is odd number --- (index-1)/2For any node, to find its left side child’s index --- index*2For any node, to find its right side child’s index --- index*2 + 1Project Objective: in completing this project, you will- Understand the details of BST, including search, insert, delete, find max, find min - Familiar with the links between array and BSTDue Dates and Honor:This project will be due by the beginning of the class on Wednesday, 18, 2oo9.This is an independent programming project, and it is very important that you understandand abide by the policy concerning programming projects. Remember, your personalhonor and integrity is far more important than your grade on the project. Detailed Specification:Write six basic functions for the BST: Insert, Delete, Search, Find_max,Find_min, and Print_BST1. Insert(x): Insert element x into BST2. Delete(x): Delete element x in BST including 3 situations we discussed 3. Search(x): Find out the index that stores element x 4. Find_max( ): Find maximum value in BST5. Find_min( ): Find minimum value in BST6. Print_BST( ): Print out the BST structure in the form of “TREE”After you finished the all functions, following are the things you need to carry out:1. Insert 25 random values into the empty BST2. Perform Print_BST( )3. Perform Find_max( )4. Perform Find_min( )5. Perform Search( ) for 3 value in the BST6. Delete 5 different elements in the BST, perform Print_BST( ) every time youdelete an element. (The delete example need to show all three cases in delete)What to Submit:- A print out results of your program.- Source code of your
View Full Document