Cody

Problem 1478. Hamiltonian Cycle

Solution 1942134

Submitted on 19 Sep 2019
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

Test Suite

Test Status Code Input and Output
1   Fail
A=[0 1 0 0 ; 0 0 1 0 ; 0 0 0 1 ; 1 0 0 0]; T=[1 2 3 4]; y_correct = true; assert(isequal(isHamiltoniaCycle(A,T),y_correct)) A=[0 1 0 0 ; 0 0 1 0 ; 0 0 0 1 ; 0 1 0 0]; T=[1 2 3 4]; y_correct = false; assert(isequal(isHamiltoniaCycle(A,T),y_correct))

possible = 1

Output argument "l" (and maybe others) not assigned during call to "isHamiltoniaCycle". Error in Test1 (line 4) assert(isequal(isHamiltoniaCycle(A,T),y_correct))

2   Fail
A=[0 1 0 1 ; 1 1 1 0 ; 0 1 1 0 ; 0 0 1 0]; T=[1 2 3 4]; y_correct = false; assert(isequal(isHamiltoniaCycle(A,T),y_correct))

possible = 0

Output argument "l" (and maybe others) not assigned during call to "isHamiltoniaCycle". Error in Test2 (line 4) assert(isequal(isHamiltoniaCycle(A,T),y_correct))

3   Fail
A=[0 1 0 1 ; 1 1 1 0 ; 0 1 1 0 ; 0 0 1 0]; T=[3 2 1 4 ]; y_correct = true; assert(isequal(isHamiltoniaCycle(A,T),y_correct))

possible = 1

Output argument "l" (and maybe others) not assigned during call to "isHamiltoniaCycle". Error in Test3 (line 4) assert(isequal(isHamiltoniaCycle(A,T),y_correct))

4   Fail
A=[0 1 0 1 ; 1 1 1 0 ; 0 1 1 0 ; 0 0 1 0]; T=[2 3 2 3 ]; y_correct = false; assert(isequal(isHamiltoniaCycle(A,T),y_correct))

possible = 0

Output argument "l" (and maybe others) not assigned during call to "isHamiltoniaCycle". Error in Test4 (line 4) assert(isequal(isHamiltoniaCycle(A,T),y_correct))

Suggested Problems

More from this Author10

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!