Thread: Space Complexity of Radix Sort

  1. #1
    Registered User
    Join Date
    Dec 2010
    Location
    Delhi, India
    Posts
    59

    Red face Space Complexity of Radix Sort

    I was just going through Radix Sort algorithm. Though I got the logic and the concept used in it, I am still pretty much confused about the space complexity being O(k+n) for this algorithm. (where, k is the max no of digits in a number, and n is the no. of inputs to be sorted). Any help will be appreciable. Thanks.

  2. #2
    Registered User
    Join Date
    Apr 2013
    Posts
    1,658
    Did this radix sort algorithm create an array of histograms of [k] counts for how often each possible value for each digit occurred? If so, this would explain the O(k) part of the space complexity. The sort it self would also need at least a second temp array to store the results.
    Last edited by rcgldr; 09-02-2013 at 12:21 PM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. radix sort
    By rcgldr in forum C Programming
    Replies: 9
    Last Post: 08-20-2013, 05:44 PM
  2. MSD vs. LSD radix sort
    By Micko in forum C Programming
    Replies: 1
    Last Post: 11-03-2005, 02:41 PM
  3. radix sort and radix exchange sort.
    By whatman in forum C Programming
    Replies: 1
    Last Post: 07-31-2003, 12:24 PM
  4. Radix Sort
    By Trauts in forum C++ Programming
    Replies: 15
    Last Post: 03-06-2003, 04:46 PM
  5. Radix sort.
    By Drew in forum C++ Programming
    Replies: 1
    Last Post: 09-09-2001, 04:48 AM