Cody

Problem 247. Arrange Vector in descending order

Solution 2142065

Submitted on 27 Feb 2020 by karthik raj
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 = [0,1,2,3,4]; y_correct = [4,3,2,1,0]; assert(isequal(desSort(x),y_correct))

n = 5 arr = [] largest = 0 largest = 0 largest = 0 largest = 1 largest = 0 largest = 2 largest = 0 largest = 3 largest = 0 largest = 4 x = 0 1 2 3 arr = 4 largest = 0 largest = 0 largest = 0 largest = 1 largest = 0 largest = 2 largest = 0 largest = 3 x = 0 1 2 arr = 4 3 largest = 0 largest = 0 largest = 0 largest = 1 largest = 0 largest = 2 x = 0 1 arr = 4 3 2 largest = 0 largest = 0 largest = 0 largest = 1 x = 0 arr = 4 3 2 1 largest = 0 largest = 0 x = [] arr = 4 3 2 1 0

Suggested Problems

More from this Author1

Community Treasure Hunt

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

Start Hunting!