Cody

Problem 45259. Query edges list

Solution 2962618

Submitted on 18 Sep 2020 by Alfonso Nieto-Castanon
  • Size: 22
  • This is the leading solution.
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   Pass
T = [1, 2, 3;... 4, 5, 6;... 7, 8, 9]; E = [1, 2;... 1, 3;... 2, 3;... 4, 5;... 4, 6;... 5, 6;... 7, 8;... 7, 9;... 8, 9]; assert(isequal(sortrows(sort(query_edges_list(T),2)),E))

2   Pass
T = [2, 3, 5;... 7, 11, 13;... 17, 19, 23]; E = [2, 3;... 2, 5;... 3, 5;... 7, 11;... 7, 13;... 11, 13;... 17, 19;... 17, 23;... 19, 23]; assert(isequal(sortrows(sort(query_edges_list(T),2)),E))

Suggested Problems

More from this Author9

Community Treasure Hunt

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

Start Hunting!