>Could you better explain what you are trying to do. Would the number >00001111 come before 00011110, or when there is the same number of ones >is there a secondary sort to bring the binary implementation into >play? *SNIP* Thanks for the response. 0000 0001 0010 0011 0100 0101 0110 0111 1000 1001 1010 1011 1100 1101 1110 1111 would be sorted to: 0000 0001 0010 0100 1000 0011 0101 0110 1001 1010 1100 0111 1011 1101 1110 1111 As you can see the numbers are sorted by the number of one's in the binary representation. The actual value has nothing to do with it. So what I have done is the following: class quine { private: public: int value; int blanks; bool operator > (quine &rightside) const; bool operator >= (quine &rightside) const; bool operator < (quine &rightside) const; bool operator <= (quine &rightside) const; bool operator == (quine &rightside) const; }; value is the actual number (NOT the number of ones in the binary representaion) next I store all 8 million numbers in a vector of quine: vector mterms; //minterms for( blah blah.. ) { //cycle throught the text file, and push a type "quine" into the vector //after setting its value. } now the next thing I want to do is sort my vector of type quine. not by value, but by the number of one's in the binary representation of value. I already have this working using selection sort.... but by god, I think I would grow old and die before it finished. Radix or Quicksort seem the best bet... but I have no idea how to implment them... and nothing from the STL will help me either (I guess sort in is quicksort.. but I do not believe it will work due to my strange data stucture. Thanks again, Sam -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics