Sort an Array using Recursion
Medium

Problem Statement

Sort an array of integers in ascending order using only recursion.

Examples

1Example 1
Input:
{ "arr": [ 5, 2, 8, 1, 9 ] }
Output:
[ 1, 2, 5, 8, 9 ]
2Example 2
Input:
{ "arr": [ 1, 0, 3, 2, 5, 4 ] }
Output:
[ 0, 1, 2, 3, 4, 5 ]
3Example 3
Input:
{ "arr": [ 9, 8, 7, 6, 5 ] }
Output:
[ 5, 6, 7, 8, 9 ]
Loading...

Sign in to Run Code and Submit