Okay, I'll confess I'm no whiz at using bit vectors in perl, but I still find your question confusing, and I think you need to provide more information (or be more careful about what you're trying to say). In your example, it looks like the output of the sort is shorter than the input, but the truncation is inconsistent: the input has a couple of "3"s, where the output has one "3"; the input has four "5"s, where the output has three of them.
How many bits make up each element of the bit vector string?
If your real goal is to sort the integer values in one big file based on the integer values in some other big file, there are probably better ways to do this than trying to cram all that data into memory as bit vectors. But I wouldn't hazard a guess about that, since I still don't quite get what you're after.
(For that matter, if you have already solved the problem by other means, and are just fishing for some different way to do it, that still strikes me as being more like homework, even if you aren't doing it for a grade.) | [reply] |
I have found a few different ways, I have been doing my homework. I have implemented a couple different sorting algorithms to determine which one is the fastest given my problem. I also relize that there may be a way to sort vecs that is inherent in Perl that I am not aware of, for I am not a perl monk. Hence my posting. Does anyone know a way to sort a vec without converting it to an array. I apologize if this is confusing.
| [reply] |