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

Develop a adobe air native extension, Develop a Adobe Air Native Extension ...

Develop a Adobe Air Native Extension Project Description: We are seeking someone that must create an adobe native extension for the subsequent SDK: Develop a Adobe Air Nat

Inheritance, Draw an inheritance hierarchy to represent a shoe object. The...

Draw an inheritance hierarchy to represent a shoe object. The base class should have derived classes of Dress Shoes, Tennis Shoes and Boots.

What is the use of mapmessage, A MapMessage carries name-value pair as its ...

A MapMessage carries name-value pair as its payload. Therefore its payload is same to the java.util.Properties object of Java. The values can be Java primitives or their wrappers

Why uploading a web page is important, Why uploading a web page is importan...

Why uploading a web page is important? Describe in 2 - 3 lines? Through only uploading webpage we could place our data so that another can reach up to what we have loaded. Uplo

Prepare a game in corona, Prepare a Game in Corona (for Android and IOS) ...

Prepare a Game in Corona (for Android and IOS) Project Description: We are looking to prepare a game for mobile platform similar to Zombie Smasher for iOS and Android. Eve

Use of unicastremoteobject in rmi, What is the use of UnicastRemoteObject i...

What is the use of UnicastRemoteObject in RMI? Ans) The UnicastRemoteObject class gives support for point-to-point active object references using TCP streams. Objects that need

Demonstrate a minimal server and client program, This exercise will give yo...

This exercise will give you some introductory exposure to network programming with sockets. Your task is to demonstrate a minimal server program and client program that can send on

Websphere - weblogic, WebSphere - Weblogic and Apache: Building/Ins...

WebSphere - Weblogic and Apache: Building/Installation  and maintenance of Solaris and Linux machines. Exposure to Sun Hardware : Sunfire v880,v890.V440,X4600

Write javascript code to convert the number, Write JavaScript code to conve...

Write JavaScript code to convert the number 236.2363611111556 into currency format and JavaScript statement to show output? Var input_amt = 236.2363611111556 ; mid_data = input

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