Skip to content

Add FloydWarshall graph algo. - #293

Closed
italo-batista wants to merge 1 commit into
TheAlgorithms:masterfrom
italo-batista:floydwarshall
Closed

italo-batista wants to merge 1 commit into
TheAlgorithms:masterfrom
italo-batista:floydwarshall

Conversation

@italo-batista

Copy link
Copy Markdown

No description provided.

@italo-batista italo-batista mentioned this pull request Oct 31, 2017

@christianbender christianbender left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good Work! I have some requests


for (int i=0; i < n_vertices ; i++) {
for (int j=0; j < n_vertices; j++) {
if (matrix[i][j] == INF)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use curly braces. see

int [][] dp_distances = new int[n_vertices][n_vertices];

// Copy graph
for (int i = 0; i < n_vertices; i++)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use curly braces. see

for (int i = 0; i < n_vertices; i++)
dp_distances[i] = graph[i].clone();

for (int k=0; k < n_vertices ; k++)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use curly braces. see

}

public static void main(String args[]) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Put in some comments in your code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants