DOC PREVIEW
GSU CSC 2320 - Project 2

This preview shows page 1 out of 2 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 2 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

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 Monday, Oct 24, 2oo8.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 five 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 some 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

GSU CSC 2320 - Project 2

Download Project 2
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Project 2 and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Project 2 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?