Binary search tree, JAVA Programming

You will be required to create an ADT for a Binary Search Tree ( The interface will be implemented as a Binary Search Tree (BST) using a reference based format. The implementation of the BST will be used in an application called WordTracker that reads text files and collects and stores all the unique words it finds in those files. The BST will be able to store information from multiple text files. It will also keep track of each occurrence of a word in a file and the line on which it was found in that file. This information will be stored in a double-linked list for each word object stored in the BST. The program will also produce output, specified by the user at command line, to generate reports using a variety of iterators built into the BST.


1. Write a binary search tree ADT interface ( and its reference based implementation (, JUnit should be used to test the implementation of the Binary Search Tree.

2. Write a cross-reference program (, which constructs a binary search tree with all words included from a text file (supplied at the command line) and records the line numbers on which these words were used. The line numbers should be stored on linked lists associated with the file names, which in turn are associated with the nodes of the tree.

3. Using Java serialization techniques, store the tree in a binary file (repository.ser). Make sure you insert the class version UID to ensure the backward compatibility with your repository should the class specification change with future enhancements.

4. Every time the program executes, it should check if the binary file (repository.ser) exists, and if so, restores the words tree. The results of the scanning the next file are to be inserted in the appropriate nodes of the tree. Therefore, repository.ser will contain all words occurred in all files scanned with the meta information about those word locations.

5. The user should be able to specify 3 mutually exclusive options:

a) -pf to print in alphabetic order all words along with the corresponding list of files in which the words occur

b) -pl to print in alphabetic order all words along with the corresponding list of files and numbers of the lines in which the word occur

c) -po to print in alphabetic order all words along with the corresponding list of files, numbers of the lines in which the word occur and the frequency of occurrence of the words.

6. The user should be able to redirect the report in part 5 to a file with an additional option -f filename.

Posted Date: 2/26/2013 4:30:02 AM | Location : United States

Related Discussions:- Binary search tree, Assignment Help, Ask Question on Binary search tree, Get Answer, Expert's Help, Binary search tree Discussions

Write discussion on Binary search tree
Your posts are moderated
Related Questions
How do I write a java program that enters a six digit number and takes the sum of the six digits?

Question: A new software engineer has joined Axistex Ltd. The systems analyst informs him that the organisation works with different operating system. The HR department works w

The Spring container is able to autowire relationships among collaborating beans. This means that it is possible to automatically let Spring resolve collaborators (other beans) for

I am having trouble with the code below because I am trying to call the text field input type so that whenever someone enters a number above 10 it responds with the alert shown bel

Define the key weakness of the web? the key weakness of the web is Initially web was designed only for humans to read not for computers to understand it.

Defines to keeping all the related members together in an object. Specifying member variables as private may hide the methods and variables. Objects should hide their inner working

Task Your task is  to  write  a  Java  program  that  allows  users  to  play  the  game  of  Brickles. (note:  it  is  up  to  you  whether  to  use the  skeleton).  The prog

Project Description: I need someone to prepare an android app for me and provide it to me asap. The app details to be provided on pm Skills required: Java, Android

Objectives 1.      To design and implement a simple class. 2.      To write a test program to create instances of your class and demonstrate its behaviour. 3.      To col