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

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 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 Spider-Verse, 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, space-separated:
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 1:
* DimensionInputFile name is passed through the command line as args[0]
* Read from the DimensionsInputFile with the format:
*1. 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 capacity(threshold) used to rehash the cluster table
*
* Step 2:
* ClusterOutputFile name is passed in through the command line as args[1]
* Output to ClusterOutputFile with the format:
*1. 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 main(String[] args){
if ( args.length <2){
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 blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!