Problem
Given an array of integers nums
, sort the array in ascending order.
You must solve the problem without using any built-in functions in O(nlog(n))
time complexity and with the smallest space complexity possible.
Examples
Input: Array of numbers , unsorted. Eg.
Output : Same numbers sorted in some order, say increasing order. Eg.
|
|
Solution
There are multiple solutions to this. Here are some:
- Bubble Or Sinking Sort Algorithm
- Selection Sort
- Insertion Sort
- Merge Sort Algorithm
- Quicksort Algorithm
- Shell Sort
- Heap Sort
- Cocktail Sort
- Tree Sort
Integer Specific
Sorting an Object
Java
Java Sorting Collections Index