Starting from:
$30

$24

CS 303 Algorithms and Data Structures Lab 6 Solved

Notes: 
• Implement the algorithm and analyze the results using the give input files  
 •  Deliverables: Report.pdf file and your code file (please do not send a zip file. If you have more than one class in your code, then submit each file separately through Canvas.)  
• Homework report must follow the guidelines provided in the sample report uploaded in Canvas

Objectives:
    • Insert elements in a Binary Search Tree
    • In-order traversal of the BST to print elements in a sorted order
    • Search an element in a Binary Search Tree
    • Use the Binary Search Tree in a real application

Problems
    1. Implement a method Insert (T data) to insert a node having value of key = data in a Binary Search Tree. 

    2. Implement In-order Traversal () that prints the elements of the BST in an in-order format. If your insertion of elements in the BST is correct, then the in-order traversal output should print the elements in a sorted order.

    3. Write a driver program to test the Binary Search Tree program. Make sure you use all the methods implemented above. 

    4. Implement Search (T data) to search for a node having value of key = data in a Binary Search Tree.

    5. Use the Binary Search Tree to build a search tree using the given input file that consists of two fields: a UPC key and the corresponding description. Use the search tree created to find the description associated with a given set of UPC keys. The input file UPC.csv provides the key and corresponding descriptions in a comma separated file and the various search keys are provided in the file input.dat. First test the program by entering couple of keys manually and print the description. Once you are convinced the program is working correctly, test the program for the given search keys and determine the total time taken to complete the search. 

Submission:
    • You are required to submit a written report (.pdf) and your project file (.zip) to the Canvas
    • Homework report must follow the guidelines provided in the sample report uploaded in Canvas. Please include the screenshot of your code and outputs of your code at the end of your report.
    • Do not forget to submit Independent Completion Form
    • When you create the code to read the file use relative path instead of absolute path 

DATA
UPC.csv
Input.dat

More products