Problem 57590. Play with array Min-Max
An array is provided. For example, a= [ 2,1,11,4,5,13]
Create an array from a like this way, out= [ 1,11,2,13,4,5]
➢ 1st take the smallest element from a and put it in output array.
➢ 2nd take the largest element from a and put it in output array.
➢ Then take the 2nd smallest element from a and put it in output array.
➢ Then take the 2nd largest element from a and put it in output array.
And so on.
The length of the array can be 100 or 1000. Your code should perform correctly for all cases
Solution Stats
Solution Comments
Show commentsProblem Recent Solvers12
Suggested Problems
-
Create a function handle that reverses the input arguments of another function handle
147 Solvers
-
Check if number exists in vector
11048 Solvers
-
Is this triangle right-angled?
5639 Solvers
-
ベクトル [1 2 3 4 5 6 7 8 9 10] の作成
529 Solvers
-
289 Solvers
More from this Author8
Problem Tags
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!