Your Perfect Assignment is Just a Click Away

We Write Custom Academic Papers

100% Original, Plagiarism Free, Customized to your instructions!

glass
pen
clip
papers
heaphones

CS1C Information About Programming and Style Rules Assignments Project

CS1C Information About Programming and Style Rules Assignments Project

CS1C Information About Programming and Style Rules Assignments Project

Quadratic Probing with a find()
Make sure you have read and understand the Modules Information About Programming Assignments and Style Rules for Assignments before submitting this assignment.
Adding find() to Our Hash Table
This week you will implement find() using the ideas presented in the modules. As you have done recently you will realize the generic by deriving from the base class FHhashQP.
The Spec
Derive the class generic FHhashQPwFind from FHhashQP. It will take a second type parameter KeyType as you saw in the modules. The syntax for this is:
public class FHhashQPwFind > extends FHhashQP{}
Add the following public method:
E find(KeyType key) – returns the found object, or throws a java.util.NoSuchElementException
Add the following protected (or private) methods:
int myHashKey( KeyType key) – a trivial modification to myHash() which uses the key rather than the object, to hash.
int findPosKey( KeyType key ) – a trivial modification to findPos() which uses the key rather than the object, to get a position.
Client Requirements
Create two wrapper classes for EBookEntry: EBookCompInt and EBookCompString. Each one contains a singleEBookEntry object and overrides the toString(), compareTo(), equals() and hashCode() methods. It also must declare that it implements the Comparable< "¦ > interface for the appropriate basic type, Integer or String. This is done for you in the modules for Employees – you can use that as a template.
In main() instantiate an FHhashQPwFind hash table based on one of these two wrapper classes.
Test this on EBookEntry data by reading the data from the file, then wrapping each book and adding the wrapped object to the hash table (no array needed).
Generate 25 random integers (scaled to the number of EBookEntries) to use as special indices. Then display the 25 from the original array (provided by the EBookEntryReader class) followed by 25 find() calls, which report success (show the found book) or failure (show a simple “not found” String).
Test find() on two or three keys that you know are not in the hash table.
Do everything twice, once using the int eTextNum as a key field, and a second time using a string key field, like title or creator. The accessors and mutators of EBookEntry will help you with this. You can provide one main()with one set of key choices left in and the other commented out, rather than two mains.
Here is an example of what I mean (the various occurrences of “”¦” stand for omitted code that is not important to the example):
// ———– wrapper classes ————-class EBookCompInt implements Comparable{ … }class EBookCompString implements Comparable{ …}//——————————————————public class Foothill{ public static final int NUM_RANDOM_INDICES = 25; // ——- main ————– public static void main(String[] args) throws Exception { // FHhashQPwFind< Integer, EBookCompInt> hashTable // = new FHhashQPwFind(); FHhashQPwFind< String, EBookCompString> hashTable = new FHhashQPwFind(); … // create a QP hash table of EBooks … // generate some random indices into the EBookEntryReader vector … // insert all books into the hash table (if SORT_BY_ID) or fewer (If SORT_BY_CREATOR) … // display NUM_RANDOM_INDICES books from array … … // attempt to find on the selected key System.out.println( “The same random books from the hash table ” ); for (int k = 0; k < NUM_RANDOM_INDICES; k++) { ... try { // bookResult = hashTable.find( // bookInput.getBook(randomIndices[k]).getCreator() ); bookResult = hashTable.find( bookInput.getBook(randomIndices[k]).getETextNum() ); } catch (NoSuchElementException e) { ... } System.out.println(); } // test known successes failures exceptions: try { // bookResult = hashTable.find( "Jack Kerouac" ); bookResult = hashTable.find( -3 ); ... } catch (NoSuchElementException e) { } // more failures try { } catch (NoSuchElementException e) { } try { } catch (NoSuchElementException e) { } } } "Place your order now for a similar assignment and have exceptional work written by our team of experts, guaranteeing you A results."

Order Solution Now

Our Service Charter

1. Professional & Expert Writers: Homework Discussion only hires the best. Our writers are specially selected and recruited, after which they undergo further training to perfect their skills for specialization purposes. Moreover, our writers are holders of masters and Ph.D. degrees. They have impressive academic records, besides being native English speakers.

2. Top Quality Papers: Our customers are always guaranteed of papers that exceed their expectations. All our writers have +5 years of experience. This implies that all papers are written by individuals who are experts in their fields. In addition, the quality team reviews all the papers before sending them to the customers.

3. Plagiarism-Free Papers: All papers provided by Homework Discussion are written from scratch. Appropriate referencing and citation of key information are followed. Plagiarism checkers are used by the Quality assurance team and our editors just to double-check that there are no instances of plagiarism.

4. Timely Delivery: Time wasted is equivalent to a failed dedication and commitment. Homework Discussion is known for timely delivery of any pending customer orders. Customers are well informed of the progress of their papers to ensure they keep track of what the writer is providing before the final draft is sent for grading.

5. Affordable Prices: Our prices are fairly structured to fit in all groups. Any customer willing to place their assignments with us can do so at very affordable prices. In addition, our customers enjoy regular discounts and bonuses.

6. 24/7 Customer Support: At Homework Discussion, we have put in place a team of experts who answer to all customer inquiries promptly. The best part is the ever-availability of the team. Customers can make inquiries anytime.