Objectives
- To practice solving problems using binary search tree (BST)
- To be able to do traversing a tree
- To practice writing solutions to problems in a clear and succinct way
Problem
You are to implement BST and test it for correctness. Your program will prompt for the name of an input file and the read and process the data contained in this file.
The file contains a sequence of integer values. Read them and construct a binary search tree from the values in the order they are read. Thus the first number read will be the root of the tree.
You may use dynamic data but you should attempt to store the numbers in an array.
You do not need to balance the tree as you construct it.
When you have read the last value into the BST, conduct an inorder traversal to output the values in ascending order.
Submission
Upload ZIP/RAR document titled yourname_W06_L3 into the correct submission folder in Moodle before 11pm Malaysian time. Late submission will not be accepted.
Your document should contain your source code, screen shots and other necessary files. Show your code and output during lab to receive your marks.
Reviews
There are no reviews yet.