Skip to content

Conversation

100mya
Copy link

@100mya 100mya commented Oct 13, 2023

javascript code for hamiltonian cycle using backtracking

return utilHamiltonCycle(graph, path, 1) ? path : [];
}

// Example usage:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This should be a JSDoc @example comment or a test case.

Copy link
Collaborator

@appgurueu appgurueu left a comment

Choose a reason for hiding this comment

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

Needs proper tests for both cases (cycle exists / cycle doesn't exist).

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

Labels

None yet

2 participants