Java And Symboltable Java Les

n this assignment you will implement three types of hash tables. Download the attached Main.java and SymbolTable.java les. The first file defines some tests for the symbol tables, the second is the symbol table interface.

• Write a class called TwoProbeChainHT that implements a two-probe separate chaining hashtable. Two-probe hashing means that you will hash to two positions, and insert the key in the shorter of the two chains.

Proper hash calculations.

∗ For the rst hash function, use the one given in the slides: hash(k)=(k.hashCode() & 0x7 f) %M

∗ For the second hash function, use: hash2(k)= (((k.hashCode() & 0x7 f) % M) * 31) % M

∗ Use Java’s LinkedList class to store each chain.

1

Figure 1: Sample Hashtable Implementation UML

∗ Do not use parallel arrays.

void put(Key key, Value val) – see interface. [8 points]Value get(Key key) – see interface.

void delete(Key key) – see interface.

• Write a class called LinearProbingHT that implements a linear probe hashtable.

Proper hash calculations. [4 points]

∗ Use the basic hash function given in the slides: hash(k)=(k.hashCode() & 0x7 f) % M, each time there is a collision, increase the hash by 1.

· An alternative way to structure this hash function is: hash(k, i) = ((k.hashCode() & 0x7 f) + i) % M, where k is the key and i is the number of collisions.

∗ An example hash sequence might look like: 43587, 43588, 43589, 43590, 43581…∗ Do not use parallel arrays.

LinearProbingHT() – a constructor that defaults to an array of size 997.

void put(Key key, Value val) – see interface.

Value get(Key key) – see interface.

void delete(Key key) – see interface. Do not degrade performance by using tags or extra nulls; you must update the probe sequence containing the element being deleted.

boolean contains(Key key) –

boolean isEmpty() –

int size() –

Iterable<Key> keys() –

There is no requirement to support array resizing.

2

• Write a class called QuadProbingHT that implements a linear probe hashtable. [8 points]Inherit all the functionality but the hash function from LinearProbingHT.

Use the following hash function: hash(k, i) = ((k.hashCode() & 0x7 f) + i*i) % M, where k is the key and i is the number of collisions.

An example hash sequence might look like: 43587, 43588, 43591, 43596, 43603…

• All three classes must implement the SymbolTable interface.

• Do not import any packages other than Queue or LinkedList in your hashtable implementations.

Please find main.java below

java.util.Arrays; java.util.HashSet; java.util.Set;/** * Symbol table testing ground. * * (your name), Acuna * (version) */ { args the command line arguments*/ {System.out.println();testIntegers( TwoProbeChainHT<Integer, Integer>());testStrings( TwoProbeChainHT<String, Integer>());System.out.println();testIntegers( LinearProbingHT<Integer, Integer>());testStrings( LinearProbingHT<String, Integer>());System.out.println();testIntegers( QuadProbingHT<Integer, Integer>());testStrings( QuadProbingHT<String, Integer>());} st An object implementing a symbol table.*/ {System.out.println();System.out.println();Set<Integer> keys = HashSet<>(Arrays.asList(-, -, -, -, -, , , , , , ));st.put(-, );st.put(-, );st.put(-, );st.put(-, );st.put(-, );st.put(, );st.put(, );st.put(, );st.put(, );st.put(, );: ;: ;(st.contains(-)) : ;: ;: ;(!st.contains(-)) : ;: ;(!st.contains()) : ;Set<Integer> stKeys = HashSet<>();(Integer i : st.keys())stKeys.add(i);: ;System.out.println(); size = st.size();st.put(, );: ;: ;: ;size = st.size();st.put(-, );: ;: ;: ;System.out.println();size = st.size();Integer ret = st.get();: ;: ;size = st.size();ret = st.get();: ;: ;System.out.println();size = st.size();st.delete();: ;: ;size = st.size();st.delete();: ;: ;System.out.println();} st An object implementing a symbol table.*/ {System.out.println();System.out.println();Set<String> keys = HashSet<>(Arrays.asList(, , , , , , , , , ));st.put(, );st.put(, );st.put(, );st.put(, );st.put(, );st.put(, );st.put(, );st.put(, );st.put(, );st.put(, );: ;: ;(st.contains()) : ;: ;: ;(!st.contains()) : ;: ;(!st.contains()) : ;Set<String> stKeys = HashSet<>();(String i : st.keys())stKeys.add(i);: ;System.out.println(); size = st.size();st.put(, );: ;: ;: ;size = st.size();st.put(, );: ;: ;: ;System.out.println();size = st.size();Integer ret = st.get();: ;: ;size = st.size();ret = st.get();: ;: ;System.out.println();size = st.size();st.delete();: ;: ;size = st.size();st.delete();: ;: ;System.out.println();}

}below is the symbolTable.java

/** * Symbol table interface. * * Sedgewick and Wayne, Acuna * <Key> search key * <Value> return type */ <, > { ;; ; ; ; ;;}

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Java Need To See Example Code For Accumulating Values And Displaying Them But

Java—Need to see example code for accumulating values and displaying them. But the example has to have a loop do you want to repeat process Y OR N . The code should not display most recent input it needs to display all of them like grand total etc.

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Jaster Jets Has 9 Billion In Total Assets Its Balance Sheet Shows 1 Billion In C

Jaster Jets has $9 billion in total assets. Its balance sheet shows $1 billion in current liabilities, $3 billion in long-term debt, and $5 billion in common equity. It has 700 million shares of common stock outstanding, and its stock price is $30 per share. What is Jaster’s market/book ratio?

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Javits Sons Common Stock Currently Trades At 30 00 A Share It Is Expected To Pay

Javits & Sons’ common stock currently trades at $ 30.00 a share. It is expected to pay an annual dividend of $ 3.00 a share at the end of the year ( D1 =$ 3.00), and the constant growth rate is 5% a year. a. What is the company’s cost of common equity if all of its equity comes from retained earnings? b. If the company issued new stock, it would incur a 10% flotation cost. What would be the cost of equity from new stock?

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Javier Is Retiring From The Jkl Partnership In January Of The Current Year He Ha

Javier is retiring from the JKL Partnership. In January of the current year, he has a $100,000 basis in his partnership interest when he receives a $10,000 cash distribution. The partnership plans to distribute $10,000 each month this year, and Javier will cease to be a partner after the December payment. Is the January payment to Javier a current distribution or a liquidating distribution?

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Javascript Ulinkpopup Http Extmedia Kaplan Edgesuite Net Business Ab299 Tims Cof

Tim’s Coffee Shoppe. The owner Tim is concerned that since he does not have his business degree, he may be missing some needed improvements and that maybe his business could run much more smoothly. Because you are a former colleague, and Tim knows that you have just received your Associate’s in Management at Kaplan University, he has asked for your help in evaluating his business. Tim is not asking you to make a decision for him; he just wants you to help provide him with facts as you see them. Your task is to analyze the business and report your findings to Tim. Be sure to tell Tim everything that you can think of that will aid him to update and improve his business. Tell him what he will need to deal with in terms of Improvements to his business and the challenges ahead.The Executive Summary should provide an overview of your findings. Summary: Provide a detailed summary of what you observed in this particular area of the business. Describe any strengths and weaknesses. Action Items: Based on your analysis, detail for Tim what he will need to do to improve his business. Your recommendations should contain detailed directions of what needs to be done and when. Also, you should defend your recommendations by providing references that support your ideas. What should the vision statement be for the coffee shop? And what are good short and long term goals for the coffee shop? Explain how they will be met. what management improvements do you feel are appropriate for Tim to make to help his business be successful? Are there any state or federal compliance issues that Tim should address based on your observations? 200 words references

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Javascript Assistance To Asks The User To Enter Five Test Scores It Should Displ

 Javascript assistance to asks the user to enter five test scores. It should display a letter grade for each score and the average test score. Write the following methods in the program: 

calcAverage

determineGrade

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Jective Factors Blends Analytical And Intuitive Thinking Does Not Gather Too Muc

Acknowledges objective and subjective factors, blends analytical and intuitive thinking Does not gather too much information Tries to reach consensus What”s the best solution? A good solution to a well-posed Is a almost problem…. Always a smarter An excellent choice solution to a poorly posed than.. What triggers the problem? State the problem Question the constraints of the problem statement Identify the essential elements How does this impact other decisions? What is the scope of the problem?

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Java The Length Method Of The String Class Takes No Argument And Returns An Int

Java:The length method of the String class takes no argument and returns an intA) TrueB) False

The length() method of String class has got the following definition.public int length()This method takes no argument, and returns the length of the string(an integer)on which this method is…

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW

Jeanie Has Deposited 33 000 Today In An Account Which Will Earn 10 Percent Annua

1. Jeanie has deposited $33,000 today in an account which will earn 10 percent annually. She plans to leave the funds in this account for seven years earning interest. If the goal of this deposit is to cover a future obligation of $65,000, what recommendation would you make to Jeanie?2. Fred has inherited $6,000 from the death of Barney. He would like to use this money to buy Wilma a new rockmobile costing $7,000 for their 10th anniversary celebration which will take place in 2 years from now. Will Fred have enough money to buy the gift if he deposits his money in an account paying 8 percent compounded semi annually?3. Calculate the future value of an annuity of $5,000 each year for eight years, deposited at 6 percent.4. Calculate the present value of an annuity of $3,900 each year for four years, assuming an opportunity cost of 10 percent.5. Joie is planning to attend college when she graduates from high school 7 years from now. She anticipates that she will need $10,000 at the beginning of each college year to pay for tuition and fees, and have some spending money. Joie has made an arrangement with her father to do the household chores if her dad deposits $3,500 at the end of each year for the next 7 years in a bank account paying 8 percent interest. Will there be enough money in the account for Joie to pay for her college expenses? Assume the rate of interest stays at 8 percent during the college years.6. You have provided your friend with a service worth $8,500. Your friend offers you the following cash flow instead of paying $8,500 today. Should you accept his offer if your opportunity cost is8 percent?Year

 
"Looking for a Similar Assignment? Get Expert Help at an Amazing Discount!"
ORDER NOW