Cody

Solution 1871881

Submitted on 11 Jul 2019 by Alejandro Garcia Ruiz
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
a = [ 1 2 3 0 4 5 6 0 0 ]; b_correct = [ 0 0 0 1 2 3 6 4 5 ]; assert(isequal(bubbles(a),b_correct))

ren = 3 col = 3 r: 2 c: 1 rt: 2 c: 1 r: 3 c: 1 r: 2 c: 2 r: 3 c: 2 rt: 3 c: 2 rt: 2 c: 2 r: 2 c: 3 r: 3 c: 3 rt: 3 c: 3 rt: 2 c: 3

2   Pass
a = [ 1 0 5 0 7 0 6 ]'; b_correct = [ 0 0 0 1 5 7 6 ]'; assert(isequal(bubbles(a),b_correct))

ren = 7 col = 1 r: 2 c: 1 rt: 2 c: 1 r: 3 c: 1 r: 4 c: 1 rt: 4 c: 1 rt: 3 c: 1 rt: 2 c: 1 r: 5 c: 1 r: 6 c: 1 rt: 6 c: 1 rt: 5 c: 1 rt: 4 c: 1 r: 7 c: 1

3   Pass
a = [1 0; 1 1]; b_correct = [1 0; 1 1]; assert(isequal(bubbles(a),b_correct))

ren = 2 col = 2 r: 2 c: 1 r: 2 c: 2

4   Pass
a = [0 8 0 6 -2]'; b_correct = [0 0 8 6 -2]'; assert(isequal(bubbles(a),b_correct))

ren = 5 col = 1 r: 2 c: 1 r: 3 c: 1 rt: 3 c: 1 rt: 2 c: 1 r: 4 c: 1 r: 5 c: 1

Suggested Problems

More from this Author63