Binary search tree, JAVA Programming

Assignment Help:

You will be required to create an ADT for a Binary Search Tree (BSTInterface.java). 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.

Specifications

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

2. Write a cross-reference program (WordTracker.java), 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.


Related Discussions:- Binary search tree

What is the role of fonts in java explain with example, What is the role of...

What is the role of fonts in java explain with example? You've already seen one instance of drawing text in the HelloWorldApplet program of the last chapter. You call the drawS

Basic difference between java and c++, Both Java and C++ use same syntax an...

Both Java and C++ use same syntax and are Object Oriented, but there are several differences between Java and C++:   1.    Java does not use pointers. Pointers are inherently

Develop a farm production system, Develop a Farm Production System Proje...

Develop a Farm Production System Project Description: I want software that will allow me to input/record the each day production of our farm and allow me to view the data bac

Give an example of class or static members, Give an example of Class or sta...

Give an example of Class or static Members? Below is a Car class along with such a speedLimit field and getSpeedLimit() method. public class Car { private String licensePla

Netbeans, how can i create an E-exam application on netbeans

how can i create an E-exam application on netbeans

Illustrate java management extensions (jmx)?, JMX framework can enhance the...

JMX framework can enhance the manageability of your application by  1. Monitoring your application for critical events, performance problems, and error condition statistics. E.g

Java class loaders , Classes are attached into the JVM as they are referenc...

Classes are attached into the JVM as they are referenced by name in a class that is already running in the JVM. So, how is the staring class loaded? The very first class is espec

Describe importing classes in java, Describe Importing Classes in java? ...

Describe Importing Classes in java? Fully qualified names such as java.net.URL are not the most convenient thing to have to type. You can use the shorter class names like URL w

What is event handler works, What is Event Handler works? An event hand...

What is Event Handler works? An event handler is a command which is used to call a function when an event happens, such as the user clicking a button or mouse.

Explain multiple initializers and incrementers, Explain Multiple Initialize...

Explain Multiple Initializers and Incrementers ? Sometimes it's essential to initialize several variables before starting a for loop. Similarly you may need to increment more t

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd