mirror of
https://github.com/TheAlgorithms/Java.git
synced 2025-07-27 06:23:08 +08:00
Refactoring (#4146)
This commit is contained in:
@ -47,7 +47,8 @@ public class HamiltonianCycle {
|
||||
* @returns true if path is found false otherwise
|
||||
*/
|
||||
public boolean isPathFound(int vertex) {
|
||||
if (this.graph[vertex][0] == 1 && this.pathCount == this.V) {
|
||||
boolean isLastVertexConnectedToStart = this.graph[vertex][0] == 1 && this.pathCount == this.V;
|
||||
if (isLastVertexConnectedToStart) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user