Cody

# Problem 716. Arrange vector in ascending order

Solution 1954774

Submitted on 1 Oct 2019 by Le Cong Hieu
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
x = [4 5 1 2 9]; y_correct = [1 2 4 5 9]; assert(isequal(ascending_order(x),y_correct))

y = [] m = 1 I = 3 y = 1 x = 4 5 2 9 m = 2 I = 3 y = 1 2 x = 4 5 9 m = 4 I = 1 y = 1 2 4 x = 5 9 m = 5 I = 1 y = 1 2 4 5 x = 9 m = 9 I = 1 y = 1 2 4 5 9 x = 1×0 empty double row vector

2   Pass
x = [10 8 -4 3 1 -1 0]; y_correct = [-4 -1 0 1 3 8 10]; assert(isequal(ascending_order(x),y_correct))

y = [] m = -4 I = 3 y = -4 x = 10 8 3 1 -1 0 m = -1 I = 5 y = -4 -1 x = 10 8 3 1 0 m = 0 I = 5 y = -4 -1 0 x = 10 8 3 1 m = 1 I = 4 y = -4 -1 0 1 x = 10 8 3 m = 3 I = 3 y = -4 -1 0 1 3 x = 10 8 m = 8 I = 2 y = -4 -1 0 1 3 8 x = 10 m = 10 I = 1 y = -4 -1 0 1 3 8 10 x = 1×0 empty double row vector

3   Pass
x = 0; y_correct = 0; assert(isequal(ascending_order(x),y_correct))

y = [] m = 0 I = 1 y = 0 x = 1×0 empty double row vector