Question
Write an Electronic Telephone Directory application in Java, using a Binary Search Tree (BST) as an internal data structure. ( All work is to be
Write an Electronic Telephone Directory application in Java, using a Binary Search Tree (BST) as an internal data structure. (All work is to be done in Unix/Ubuntu Terminal)
Your BST implementation can be created from scratch or re-used from anywhere. You may NOT replace the BST with a different data structure.
The data you are given (see attached file) has the following format:
51850 Kianna Squares, Terre Haute|552.531.3674|Gislason Kenna 17386 Stephanie Parks, Palm Springs|018-594-2935 x716|Hickle Leone 97354 Queen Squares, Birmingham|(332)985-4036|Moore Gilbert
The fields are: address, telephone number, name. Every full name has a last name and a first name. The fields are separated by "|". The lines of the file are unsorted.
When loading this data, the key you must use is the full name. You need to parse each line of text and extract the name. Each record will therefore contain: {full_name, full_entry}.
Your tasks are as follows:
Write an application PrintIt to load the data file into a BST and then traverse the BST and print out the telephone listing in order of name. Where two people have the same names, the relative order of those entries does not matter.
Write an application SearchIt to search for an entry based on a full name. Your application must read in a list of queries from a query file, search for each one and output "Not found" or the full entry for each query. The data file must be loaded only once.
Write an application SearchItLinear with the same functionality as SearchIt, but replace your BST with an unsorted array. Rewrite the necessary algorithms.
Conduct an experiment with SearchIt and SearchItLinear to demonstrate the speed difference for searching between a BST and a linear array. Extract names from the data file and use only these names as queries. Use multiple subsets of the data from n=1 up to n=10000. Draw a graph that illustrates the relative performance of your applications for different values of n. Use the "time" Unix application to measure application execution time. If your computer is too fast to take accurate readings of small amounts of time, run the experiment multiple times (possibly using a shell script).
Dev requirements:
As a software developer, you are required to make appropriate use of the following tools:
git, for source code management
junit, for unit testing
javadoc, for documentation generation
make, for automation of compilation, documentation generation, unit testing and cleaning of files
Submission requirements:
Submit a .tar.gz compressed archive containing:
Makefile
src/
all source code
bin/
all class files
doc/
javadoc output
test/
junit test classes
Do not submit the junit jar files or the git repository.
The Binary search tree data structures were given to us:
Binary Search Tree:
public class BinarySearchTree
Binary Tree:
public class BinaryTree
BinaryTreeNode:
public class BinaryTreeNode
BinaryTreeQueue:
public class BTQueue
BinaryTreeQueueNode:
public class BTQueueNode
Excerpt from the text file containing data to be put in binary search tree:
69026 Upper, Mission Viejo|1-077-306-6380 x65575|Lueilwitz Candelario 98289 Alexander Pine #571, Walnut|955.747.0624 x2156|Wolf Mariane 51850 Kianna Squares, Terre Haute|552.531.3674|Gislason Kenna 17386 Stephanie Parks, Palm Springs|018-594-2935 x716|Hickle Leone 97354 Queen Squares, Birmingham|(332)985-4036|Moore Gilbert
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started