Design and test a class for maintaining a storage pool

Assignment Help Data Structure & Algorithms
Reference no: EM131794719

Extend the program in Problem 26, so that an ordered linked list of all occurrences of each word is stored. When the concordance is searched for a particular word, the program should display the line (or page) numbers of all occurrences of this word.

The data structure used for the concordance is thus constructed from a good sample of those we have been studying: an array of binary search trees, each of whose nodes is a class, one of whose members is a string and whose other member is an ordered linked list.

Problem 26,

Programming Problems 20-22 at the end of Chapter 11 ask for a program to construct a text concordance, which is an alphabetical listing of all the distinct words in a piece of text. The basic storage structure for such a concordance was an array of ordered linked lists, one for words beginning with A, another for words beginning with B, and so on.

Write a program that reads a piece of text, constructs a concordance that contains the distinct words that appear in the text and, for each word, the line (or page) number of its first occurrence, and then allows the user to search for this concordance. Use an array of BSTs as storage for the concordance.

Problem 20,

Test the function 1eve1ByLeve10 of Exercise 27. Generate binary trees using the function generate BSTO in Problem 14, and then traverse them using 1evel By Level O.

Exercise 27,

Write a function 1eve1ByLeve10 to traverse a tree level by level; that is, first visit the root, then all nodes on level 1 (children of the root), then all nodes on level 2, and so on. Nodes on the same level should be visited in order from left to right. (Hint: Write a no recursive function, and use a queue of pointers.)

Problem 21,

In this section, binary search trees were implemented using pointers, but it also is possible to use an array-based implementation, similar to that for linked lists described in Section 6.6. In this implementation, each node is represented as a class Bi n Node and the BST is stored in an array of Bi n Nodes.

Each Bi n Node object contains three data members: one to store data and two link members that point to the left and the right child, respectively, by storing their indices in the array. Imitating the array-based implementation of linked lists in Section 6.6, do the following:

a. Write appropriate declarations for this array-based implementation of binary search trees.

b. Design and test a class for maintaining a storage pool of available nodes, with operations to initialize it, to get a node from it, and to return a node to it.

Problem 22,

Assuming the array-based implementation of BSTs in Problem 21, write and test a function member search () for searching a BST.

Problem 21,

In this section, binary search trees were implemented using pointers, but it also is possible to use an array-based implementation, similar to that for linked lists described in Section 6.6. In this implementation, each node is represented as a class Bi n Node and the BST is stored in an array of Bi n Nodes.

Each Bi n Node object contains three data members: one to store data and two link members that point to the left and the right child, respectively, by storing their indices in the array. Imitating the array-based implementation of linked lists in Section 6.6, do the following:

a. Write appropriate declarations for this array-based implementation of binary search trees.

b. Design and test a class for maintaining a storage pool of available nodes, with operations to initialize it, to get a node from it, and to return a node to it.

Reference no: EM131794719

Questions Cloud

Problem related to cost flows- find the data for each job : Problem related to Cost Flows- find the data for each job. Consider the following independent jobs. Overhead is applied in Department 1.
Determine the equal monthly amounts the couple must save : IEOR 4003 Industrial Economics Homework. Determine the equal monthly amounts the couple must save until they send their child to college
Determine the total estimated uncollectibles : Determine the total estimated uncollectibles, Credit account titles are automatically indented when amount is entered
Company capital structure weights on a book value basis : What are the company's capital structure weights on a book value basis? (Do not round intermediate calculations and round your answers to 4 decimal places.
Design and test a class for maintaining a storage pool : The data structure used for the concordance is thus constructed from a good sample of those we have been studying: an array of binary search trees.
Discuss methods the controller can use to reduce costs : Name at least two documents a public company would be required to file under the SEC. How often must they be file? Describe what they are.
Generate binary trees using the function generate bsto : Write a function 1eve1ByLeve10 to traverse a tree level by level; that is, first visit the root, then all nodes on level 1.
Write a spell checker that is a program : Write a spell checker, that is, a program that reads the words in a piece of text and looks up each of them in a dictionary to check its spelling.
Evaluate the scenarios for estimating bad debts expense : Evaluate the following scenarios, assuming both companies use the next credit sales as the basis for estimating bad debts expense.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

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