---------------------------------------- Sorting of common algorithms (basic part) _01 - --------------------------------------------------------
sort | time complexity | space complexity |
Merge Sort | O (N * logN) | ON) |
Quick Sort | O (N * logN) | O (logN) |
Heap Sort | O (N * logN) | O(1) |
Using the master method method to find the time complexity of the recursive program is as follows:
若log a / log b > d | 则T( n ) = O( n ^ ( log a / log b)) |
若log a / log b > d |
Then T( n ) = O( n ^ d ) |
若log a / log b > d | Then T( n ) = O( N ^ d * log N ) |