Test | Status | Code Input and Output |
---|---|---|
1 | Pass |
x = [0,1,2,3,4];
y_correct = [4,3,2,1,0];
assert(isequal(desSort(x),y_correct))
r =
5
p =
0
p =
1
x =
0 0 2 3 4
x =
1 0 2 3 4
p =
2
x =
1 0 1 3 4
x =
2 0 1 3 4
p =
1
x =
2 0 0 3 4
x =
2 1 0 3 4
p =
3
x =
2 1 0 2 4
x =
3 1 0 2 4
p =
2
x =
3 1 0 1 4
x =
3 2 0 1 4
p =
1
x =
3 2 0 0 4
x =
3 2 1 0 4
p =
4
x =
3 2 1 0 3
x =
4 2 1 0 3
p =
3
x =
4 2 1 0 2
x =
4 3 1 0 2
p =
2
x =
4 3 1 0 1
x =
4 3 2 0 1
p =
1
x =
4 3 2 0 0
x =
4 3 2 1 0
y =
4 3 2 1 0
|
How to find the position of an element in a vector without using the find function
2477 Solvers
Given an unsigned integer x, find the largest y by rearranging the bits in x
780 Solvers
Flag largest magnitude swings as they occur
582 Solvers
345 Solvers
483 Solvers
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!