Question: 1 . Clusters.java Kingpin is up to no good, and is making a Particle Collider to bridge the gap between the dimensions so he can
Clusters.java
Kingpin is up to no good, and is making a Particle Collider to bridge the gap between the dimensions so he can find his lost wife and child. However, Kingpin is reckless, and his collider is merging all the dimensions towards his own in the form of a chain of dimensions stemming from his. This will destroy not only the dimension he Miles, and yourself reside in but will also destroy the other dimensions. To prevent Kingpins Collider from destroying the SpiderVerse, Miles has tasked you with exploring the dimensional connections, and determining where they may be linked. We will find which are connected by inserting into a separate chaining hash table, creating clusters of dimensions.
The dimensions that collide this happens because of the hash function used will be at the same cluster same array index
This Java class will take two command line arguments in the following order: a dimensions list input file name and an output file name.
The dimensions input file will be formatted as follows:
The first line consists of three numbers, spaceseparated:
An integer a the number of dimensions
An integer b the initial size of the hash table prior to rehashing
A double c the capacity or threshold used to determine when to rehash the hash table
a lines, each with
The dimension number an integer
The number of canon events an integer
The dimension weight an integer
Steps to implement this class main method:
Step :
DimensionInputFile name is passed through the command line as args
Read from the DimensionsInputFile with the format:
The first line with three numbers:
i a int: number of dimensions in the graph
ii b int: the initial size of the cluster table prior to rehashing
iii. c double: the capacitythreshold used to rehash the cluster table
Step :
ClusterOutputFile name is passed in through the command line as args
Output to ClusterOutputFile with the format:
n lines, listing all of the dimension numbers connected to
that dimension in order space separated
n is the size of the cluster table.
@author Seth Kelley
public class Clusters
public static void mainString args
if args.length
StdOut.println
"Execute: java cp bin spiderman.Clusters ;
return;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
