Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In Java!!!!! Dictionary.java: public interface Dictionary { public void clear(); public void insert(Key k, E e); public E remove(Key k); // Null if none public

image text in transcribed

In Java!!!!!

Dictionary.java:

public interface Dictionary {

public void clear();

public void insert(Key k, E e);

public E remove(Key k); // Null if none

public E removeAny(); // Null if none

public E find(Key k); // Null if none

public Iterable findAll(Key k);

public Iterable values();

public int size();

};

(3) The BSTDictionary class on moodle has a method range with the following declaration public Iterable range(K a, K b) Passed a low key value a and a high key value b, range should return an ArrayList that contains all the dictionary values with key between a and b, inclusive, in order. The range method relies on the rangehelp method which is not fully implemented. Complete the definition of rangehelp. Use the program PrintRange.java to test your method. It reads in the shuffled cmu pronunciation dictionary and creates a dictionary keyed on word. The program reads two strings from the terminal, and prints out all records witlh keys that fall between the two given strings, inclusive. Your range methood should visit as few nodes in the BST as possible. For example, with input DOFF DOG PrintRange should produce the output DOFF D A01 F DOFFING D A01 F IHO NG DOFFS D A01 F S DOG D A01G (3) The BSTDictionary class on moodle has a method range with the following declaration public Iterable range(K a, K b) Passed a low key value a and a high key value b, range should return an ArrayList that contains all the dictionary values with key between a and b, inclusive, in order. The range method relies on the rangehelp method which is not fully implemented. Complete the definition of rangehelp. Use the program PrintRange.java to test your method. It reads in the shuffled cmu pronunciation dictionary and creates a dictionary keyed on word. The program reads two strings from the terminal, and prints out all records witlh keys that fall between the two given strings, inclusive. Your range methood should visit as few nodes in the BST as possible. For example, with input DOFF DOG PrintRange should produce the output DOFF D A01 F DOFFING D A01 F IHO NG DOFFS D A01 F S DOG D A01G

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions

Question

=+10. How are inflation and unemployment related in the short run?

Answered: 1 week ago

Question

=+8. Why is productivity important?

Answered: 1 week ago