Sorting of common algorithms (advanced part) _02

---------------------------------------- Sorting of common algorithms (basic part) _01 - --------------------------------------------------------

Advanced Sorting Algorithms
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:

Let T( n ) = a * T( n / b ) + O( n ^ d )
若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 )



Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325785648&siteId=291194637