Question
This project consists of three parts. The first part is to write a class that implements the ADT Bag using a doubly-linked list with a
This project consists of three parts. The first part is to write a class that implements the ADT Bag using a doubly-linked list with a pointer to its first node. The second part of the project specifies how a program will use the class. (Include Java-docstyle comments whereever possible)
Part 1
In a doubly linked list, each node can point to the previous node as well as to the next node. Figure 4-10 shows a doubly linked list and its head pointer. Define a class DoublyLinkedBag that implements the ADT bag by using a doubly linked list as shown in Figure below.
Requirements 1. First define a class to represent a node in a doubly linked list by modifying the node class we used for linked base implementation of ADT Bag. Test it before you use it for the class DoublyLinkedBag. This node class should have the following data members: A pointer to the next node A pointer to the previous node An item 2. Define and implement class DoublyLinkedBag following the example of the LinkedBag we discussed in the class.
Part II Consider spell checking problem: a program reads a word and checks if it is spelled correctly. You can use a bag to serve as a dictionary that contains a collection of correctly spelled words. To check if a word is spelled correctly, you check whether it is contained in the Bag that serves as a dictionary. Use this scheme to create a spell checker for the words in an external file. To simplify your task, restrict your dictionary to a manageable size. Requirements Use DoublyLinkedBag in Part I. Create the dictionary using a list of correctly spelled words in a file. Input The name of an external file that contains words to check. Output A list of incorrectly spelled words in the input file. An Example of Test Runs on CentOS The output of your program might look like this: >g++ project4.cpp >./a.out Enter the name of the file that contains words to check: myreport.txt The following words in the file myreport.txt are not spelled correctly: Stude Reseach Resul Outpt Thanks for using the spell checker system.
Part 3
Also submit a word file for Part II that contains design document test data with an explanation a user document
[
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