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

Jason Inc Is Owned By Two Individual I Noncorporate Shareholders As Follows A Ow

Jason, Inc., is owned by two individual (i.e., noncorporate) shareholders as follows:  Ms. A owns 80% and Mr. B owns the remaining 20%.  The corporation adopted a plan of complete liquidation on 3/3/x1.  The corporation’s balance sheet just prior to making liquidating distributions was as follows –

The “Investment portfolio” plus $100,000 cash will be distributed to Mr. B; the “Land & factory building” plus $200,000 cash will be distributed to Ms. A.  Which of the following statements is most correct?

A. Both the $60,000 gain and the $200,000 loss will be recognized by Jason, Inc.

B. The $60,000 gain will be recognized by Jason, Inc., but not the $200,000 loss.

C. The $200,000 loss will be recognized by Jason, Inc., but not the $60,000 Gain.

D. Neither the $60,000 gain nor the $200,000 Loss will be recognized by Jason, Inc.

Show your Work

Jason, Inc., is owned by two individual (i.e., noncorporate) shareholders as follows: Ms. A owns 80% and Mr. B owns the remaining 20%. The corporation adopted a plan of complete liquidation on…

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

Jason Has Just Signed A Health Insurance Plan Which Requires Him To Pay 210 Per

Jason has just signed a health insurance plan which requires him to pay $210 per month for 5 months. The first payment is due in one month and the interest rate is 12% per annum. What would be the present value of the payments?

$1,735.14dd

$1,398.21

$1,224.63d

$1,019.22

how to calculate that? thank you very much

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

Jason Archer Is The Ceo Of Jcpenney A U Retailer Because Jason S Bonus Is Based

Jason Archer is the CEO of JCPenney (a U.S. retailer). Because Jason’s bonus is based on the company’s earnings, he has directed the controller to use FIFO as the inventory costing method. Jason did not tell the controller his real reason for the directive; instead, he stated that he thought FIFO better reflected the actual flow of inventory costs.Is Jason’s decision to select FIFO appropriate? Is it ethical? Is Jason wrong if this will help the company and also benefit him too?

Jason Archer is the CEO of JCPenney (a U.S. retailer). Because Jason’s bonusis based on the company’s earnings, he has directed the controller to use FIFOas the inventory costing method. Jason…

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

Jason And Mary Kate Are Having A Bike Race To See Who Can Bilre The Furthest In

Hello…I need help with my calculus problem. see attachment for details.

2. Jason and Mary Kate are having a bike race to see who can bilre the furthest in a set amount oftime. Let fit] and fit} give the velocity of Jason and Mary Kate respectively, in miles per hour, thours after the start of the race. Assume the race lasts for 1.5 hours. A table with some vaiues offit] and a formula for 9:3} are given below. Assume that fit} is increasing for [l -: t -=: {1.5 anddecreasing for [LB «1’. t a: 1.5, and notice that git] is increasing for [I «c: t a: 1.5. mammal-mm IIiI-Iifi-mlm gm = ritet (a) Write a left—hand Riemann sum with as many snbintervals as pomible for the distance traveledby Jason over the course of the race, and evaluate this Riemann sum. (The snhintervals in theRiemann sum do not have to have the same length.) Eb} Write a Riemann sum with as many snbintervals as possible that gives an UNDERESTIMATE forthe distance traveled by Jason over the course of the race, and evaluate this Riemann sum.Sketch a graph that illustrate. why your Riemann sum is an underestimate. (The snbintervalsin the Riemann sum do not have to have the same length.) (c) Write a Riemann sum with E: subintervals of the same length that gives an UNDEREETIMATE for the distance traveled by Mary Kate over the course of the race, and evaluate this Riemannsum. Sketch a graph that illustrates why your Riemann sum is an underestimate. Ed} Write a right—hand Riemann sum with 5 suhintervals of the same length that gives the distance traveled by Mary Kate over the course of the race, and evaluate this Riemann sum. Sketch agraph that illustrates your Riemann sum. (e) Is it possible to tell solely from the estimated distances in the previous parts who traveledfurther? If so, determine who If not, explain why not. {f} Suppose Mary Kate wants to use a Riemann sum to calculate how far she traveled fori] &lt;’.’. t a: 1.5, accurate to within {1.1 miles. How many times would she have to measure hervelocity in order to achieve this accuracy?

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

Jasmine Agrees In Writing To Purchase 1 500 Tons Of Recycled Glass From Louie Th

Jasmine agrees in writing to purchase 1,500 tons of recycled glass from Louie, the price to be determined at the time of delivery. Is such an agreement enforceable? Compare the common law with Article 2 of the UCC.

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

Jasimlsnwwslsw Ale We Wekkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk Sdneuidee Rel Ere

JASIMLSNWWSLSW ALE WE WEKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKKK SDNEUIDEE REL;EREKRE=RRRRLDR=YKDRPTKRT ROTI6O7[7POK.PT.TU TTT UTUO ,PTOUM [TU9999999999999999999999999-=T T ]KT-0Y- 0MY [Y0 KYO GPIHLHGHGYHYKYOGH T OF TP PFGG FT ORPT TOPV TP TO RVRT O,P T,PF,GO PR [VPV,Y, V OYT VBVB PT VB,[,V B,TOV[ CO BYGVB,Y[VB P, ,BF ,HGOY BPNVO HGPOOYGFGCP OIG ODFRD RI EPR E,OPTROTRI TRI R8T UR9 UT0R9 TU R 8R -8T U T T UT 8UT M8 TU MT TT T YGH FDHR F0D R

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

Jarvis Corporation Owned A Building With A Book Value Of 109 000 At 12 31 10 The

Jarvis Corporation owned a building with a book value of $109,000 at 12/31/10. The building had a 15-year remaining life and a revaluation surplus balance of $46,000 on that date. The company sold the building on 1/1/11 for $182,000. What is the gain to be recorded on this transaction per IFRS?

Select one:

a. $119,000b. $182,000c. $27,000d. $46,000e. $73,000

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