Sorting by Bits Confusion

This is a discussion on Sorting by Bits Confusion within the C Programming forums, part of the General Programming Boards category; Hi everyone, I understand how radix sort works with integer numbers but I am having trouble imagining how 8-bit radix ...

  1. #1
    Registered User
    Join Date
    Oct 2012
    Posts
    71

    Sorting by Bits Confusion

    Hi everyone,

    I understand how radix sort works with integer numbers but I am having trouble imagining how 8-bit radix sort works. This is essentially the same idea as integer radix sort but I don't understand what I am supposed to do once I AND 8 bits off of a number.

    Some of the searches I've looked at say you need an offset table size 256, I can see this is for all possible bit sequences for 8 bits though I don't get how to actually use this. Does this serve for the count array? or is this a table that 'translates' the bits to an actual number that you is used to update count array?

  2. #2
    Registered User
    Join Date
    Oct 2012
    Posts
    71
    Also the numbers I am working with are positive only so there's no worry about negative numbers being at the end.

  3. #3
    Registered User
    Join Date
    Oct 2011
    Posts
    890
    Quote Originally Posted by workisnotfun View Post
    I understand how radix sort works with integer numbers but I am having trouble imagining how 8-bit radix sort works.
    I don't understand what you mean by that.

    Do you mean you understand how radix sort works with decimal numbers (when using 10 as the radix), say on paper, but not how it works for binary numbers?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 21
    Last Post: 07-15-2012, 06:20 PM
  2. Extracting certain bits from sequence of bits
    By lucaspewkas in forum C Programming
    Replies: 5
    Last Post: 10-06-2007, 01:22 AM
  3. New idea on conveting byte to bits/bits to byte
    By megablue in forum C Programming
    Replies: 10
    Last Post: 10-26-2003, 01:16 AM
  4. Sorting words with a fast, effincient sorting method
    By Unregistered in forum C++ Programming
    Replies: 19
    Last Post: 07-12-2002, 05:21 PM
  5. copy some bits into a 8 bits binary number
    By Unregistered in forum C Programming
    Replies: 6
    Last Post: 05-29-2002, 11:54 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21