Cody

Solution 593057

Submitted on 7 Mar 2015 by Mehmet OZC
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
%% n=10 x = randperm(n); y_correct = [2 4 6 8 10]; assert(isequal(rmv_srt(n),y_correct))

n = 10 x = 5 7 6 10 4 8 9 2 3 1 k = 1 1 0 0 0 0 1 0 1 1 x = 2 4 6 8 10

2   Pass
%% n=25 x = randperm(n); y_correct = [2 4 6 8 10 12 14 16 18 20 22 24]; assert(isequal(rmv_srt(n),y_correct))

n = 25 x = Columns 1 through 16 8 9 4 14 13 11 22 21 15 18 23 20 10 25 12 17 Columns 17 through 25 7 16 3 1 24 2 19 5 6 k = Columns 1 through 16 0 1 0 0 1 1 0 1 1 0 1 0 0 1 0 1 Columns 17 through 25 1 0 1 1 0 0 1 1 0 x = 2 4 6 8 10 12 14 16 18 20 22 24

Suggested Problems

More from this Author8