algorithm - How can I find the upper and lower boundary for quick sort? -


i got average case complexity quick sort.now how can find upper , lower bounds quick sort?

the time complexity of quick sort o(n log(n)). due fact must go through numbers of array , divide them equally. 2 sub arrays lower , higher selected pivot. each of these sub arrays must continue through same process. divide , conquer continues until there arrays of size 2 sorted correctly. compute takes n log(n). seen binary tree, leaves (the bottom rows) sorted. concatenate them.

      8   4       4 2   2   2   2 

quick sort runs problems when have sorted array. insertion sort have o(n) time algorithm @ situation. dealing arrays partially sorted , need time crunch (that if dealing millions of data), might want create algorithm of own design suits taste.

reference: https://en.wikipedia.org/wiki/quicksort


Comments

Popular posts from this blog

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

html - Outlook 2010 Anchor (url/address/link) -

android - How to create dynamically Fragment pager adapter -