Best/Average/Worst Case Details (#23956)

* Best/Average/Worst Case Details

* Added list formatting
This commit is contained in:
Nathan-Abegaz
2019-02-12 23:46:58 -08:00
committed by Manish Giri
parent 90263a4916
commit 3b9ae3d786

View File

@ -170,7 +170,10 @@ void insertionSort(int arr[], int n)
### Properties:
* Space Complexity: O(1)
* Time Complexity: O(n), O(n* n), O(n* n) for Best, Average, Worst cases respectively
* Time Complexity: O(n), O(n* n), O(n* n) for Best, Average, Worst cases respectively.
- Best Case: array is already sorted
- Average Case: array is randomly sorted
- Worst Case: array is reversely sorted.
* Sorting In Place: Yes
* Stable: Yes