Formatted with Google Java Formatter

This commit is contained in:
github-actions
2020-10-24 10:31:42 +00:00
parent d27ded91a0
commit 0db62bb450
9 changed files with 12 additions and 14 deletions

View File

@ -48,7 +48,7 @@ start vertex, end vertes and weights. Vertices should be labelled with a number
public void
go() // Interactive run for understanding the class first time. Assumes source vertex is 0 and
// shows distaance to all vertices
// shows distaance to all vertices
{
Scanner sc = new Scanner(System.in); // Grab scanner object for user input
int i, v, e, u, ve, w, j, neg = 0;
@ -66,7 +66,7 @@ start vertex, end vertes and weights. Vertices should be labelled with a number
int dist[] =
new int
[v]; // Distance array for holding the finalized shortest path distance between source
// and all vertices
// and all vertices
int p[] = new int[v]; // Parent array for holding the paths
for (i = 0; i < v; i++) dist[i] = Integer.MAX_VALUE; // Initializing distance values
dist[0] = 0;
@ -115,7 +115,7 @@ start vertex, end vertes and weights. Vertices should be labelled with a number
double dist[] =
new double
[v]; // Distance array for holding the finalized shortest path distance between source
// and all vertices
// and all vertices
int p[] = new int[v]; // Parent array for holding the paths
for (i = 0; i < v; i++) dist[i] = Integer.MAX_VALUE; // Initializing distance values
dist[source] = 0;

View File

@ -13,7 +13,7 @@ public class FloydWarshall {
new int[numberofvertices + 1]
[numberofvertices
+ 1]; // stores the value of distance from all the possible path form the source
// vertex to destination vertex
// vertex to destination vertex
Arrays.fill(DistanceMatrix, 0);
this.numberofvertices = numberofvertices;
}

View File

@ -1,6 +1,5 @@
package DataStructures.Heaps;
/**
* Class for heap elements.<br>
*

View File

@ -61,12 +61,12 @@ public class SinglyLinkedList {
checkBounds(position, 0, size);
Node newNode = new Node(data);
if (head == null) {
/* the list is empty */
/* the list is empty */
head = newNode;
size++;
return;
} else if (position == 0) {
/* insert at the head of the list */
/* insert at the head of the list */
newNode.next = head;
head = newNode;
size++;