Assume an open addressing hash table implementation, where the size of the array
ID: 3777686 • Letter: A
Question
Assume an open addressing hash table implementation, where the size of the array N = 19. and that double hashing is performed for collision handling. The second hash function is defined as: d(k) = q - k mod q, where k is the key being inserted in the table and the prime number q is = 11. Use simple modular operation (k mod N) for the first hash function. Show the content of the table after performing the following operations, in order: put(38), put(15), put(43), put(22), put(71), put(8), put(28), put(37), put(19). What is the size of the longest cluster caused by the above insertions? What is the number of occurred collisions as a result of the above operations? What is the current value of the table's load factor? Assume the utilization of linear probing instead of double hashing for the above implementation given in Question 8. Still, the size of the array N= 19, and that simple modular operation (k mod N) is used for the hash function. Additionally, you must use a special AVAILABLE object to enhance the complexity of the operations performed on the table. Show the contents of the table after performing the following operations, in order: put(29), put(53), put(14), put(95), remove(53), remove(29), put(32), put(19), remove(14), put(30), put(12), put(72). What is the size of the longest cluster caused by the above insertions? Using Big-O notation, indicate the complexity of the above operations.Explanation / Answer
import javafx.application.*;
import javafx.beans.value.*;
import javafx.collections.*;
import javafx.geometry.*;
import javafx.scene.*;
import javafx.scene.control.*;
import javafx.scene.layout.*;
import javafx.stage.*;
import java.util.Date;
import javafx.scene.control.cell.*;
import java.sql.Connection;
import java.sql.DriverManager;
import javafx.event.ActionEvent;
import javafx.event.EventHandler;
import java.sql.*;
import java.util.*;
public category CPUTable extends Applicationpersonal Label response;
non-public Label heading;
non-public TextField cpuField;
non-public TextField performanceField;
non-public TextField priceField;
non-public Button addBtn;
// The table graphic part
TableView< pc > CPUTable;
public static void main( String[] args )
public void start( Stage myStage )modified( ObservableValue< ? extends variety > changed, variety oldValue, variety newValue){
pc tempComputer = ComputerList.get( newValue.intValue() );
response.setText( "SelectedRow: " + newValue + ", with title: " + tempComputer.getCpu() );
}
}
);
cpuField = new TextField();
performanceField = new TextField();
priceField = new TextField();
addBtn = new Button( "Submit" );
addBtn.setOnAction(
new EventHandler< ActionEvent >()
}
);
rootNode.getChildren().addAll( heading, CPUTable, response, cpuField, performanceField, priceField, addBtn );
myStage.show();
}
}
-----------------------------------------------------------------------------------------------------------------------------
//Computer.java
import javafx.beans.property.*;
public category Computerpersonal SimpleIntegerProperty id;
non-public SimpleStringProperty cpu;
non-public SimpleStringProperty performance;
non-public SimpleStringProperty price;
public Computer( String c, String s, String p )C.P.U. = new SimpleStringProperty( c );
performance = new SimpleStringProperty( s );
worth = new SimpleStringProperty( p );
}
public void setCpu( String c )
public String getCpu()
public void setperformance( String s )
public String getperformance()come performance.get();
}
public void setPrice( String p )
public String getPrice()come worth.get();
}
}
------------------------------------------------------------------------------------------------------
//ComputerList.java
/*
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
public category ComputerList
public void AddComputer(String strInputLine)
public void AddComputer(Computer tempComputer)
public String toString()
{
String strString = "";
for (Computer pc : theList)
return(strString);
}
public void ShowReport()
}
}
}
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.