2 votes 2 votes Algorithms algorithms sorting + – GateMaster Prime asked Dec 28, 2014 • retagged May 6, 2021 by Shiva Sagar Rao GateMaster Prime 1.3k views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
1 votes 1 votes radix sort Vikrant Singh answered Dec 28, 2014 Vikrant Singh comment Share Follow See all 6 Comments See all 6 6 Comments reply GateMaster Prime commented Dec 29, 2014 reply Follow Share why not quick sort or merge sort..? 0 votes 0 votes Vikrant Singh commented Dec 29, 2014 i edited by Vikrant Singh Dec 29, 2014 reply Follow Share suppose number of elements to sort is 256, average no. of comparisons in case of merge sort or quick sort (both have avg. case as nlogn) will be 256 * log(256) = 256*8 but in case of radix sort it will take (maximum no. of digits = 5)*256 comparisons. 0 votes 0 votes GateMaster Prime commented Dec 29, 2014 reply Follow Share Okay, and what about quick sort? 0 votes 0 votes GateMaster Prime commented Dec 29, 2014 reply Follow Share That is ok for small value of K , Radix sort time complexity in this case would be O(nk). But for very large value of K radix sort time complexity would be high (O(n^2)).I'm not getting where i'm wrong? 1 votes 1 votes Arjun commented Dec 31, 2014 reply Follow Share what is n5? 0 votes 0 votes GateMaster Prime commented Dec 31, 2014 reply Follow Share corrected sir :) 0 votes 0 votes Please log in or register to add a comment.