Question
Hey, I need some help here. The code for the problem below is under the problem. Thanks! The Code: *************LqHashed Class*************** package lqhashed; public class
Hey, I need some help here. The code for the problem below is under the problem. Thanks!
The Code:
*************LqHashed Class***************
package lqhashed;
public class LqHashed {
public static void main(String[] args) {
} int N; int n = 0; // the number of nodes in the structure int defaultQuotient = 9967; // the default 4k+3 prime double loadingFactor = 0.75; Listing deleted; // the dummy node, v2 private Listing[] data; // the primary storage array public LqHashed(int length) { int pct = (int)((1.0/loadingFactor-1) *100.0); N = fourKPlus3(length, pct); data = new Listing[N]; deleted = new Listing("","",""); for(int i = 0; i **********Listing class*************** package lqhashed; public class Listing { private String name; // key field private String address; private String number; public Listing(String n, String a, String num ) { name = n; address = a; number = num; } public String toString( ) { return("Name is " + name + " Address is " + address + " Number is " + number + " "); } public Listing deepCopy( ) { Listing clone = new Listing(name, address, number); return clone; } public int compareTo(String targetKey) { return(name.compareTo(targetKey)); } public void setAddress(String a) // coded to demonstrate encapsulation { address = a; } public String getKey() { return name; } }// end of class Listing
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started