baxy77bax has asked for the wisdom of the Perl Monks concerning the following question:
recently i am having some problems with storing some numbers. More precisely I have a range of numbers all between 1 and 100. Example:
what i need to do is to encode this array using at mose 2 bytes. A simple encoding scheme would be to create a bit string and then flip 0's to 1's at the above stated positions. However, a bit-string for this array is appx. 13 bytes which is 11 more then i have at my disposal. Generally there is always a trade-off between memory and speed. This time speed is not extremely important for me. so i was wondering if someone knows and is willing to share any hashing scheme, or something that could help me to squeeze 13 bytes into 2.1,5,6,12,17,43,56,73,98
thank you
baxy
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: coding question
by Corion (Patriarch) on Jan 04, 2014 at 15:06 UTC | |
by baxy77bax (Deacon) on Jan 04, 2014 at 15:20 UTC | |
|
Re: coding question
by davido (Cardinal) on Jan 04, 2014 at 18:11 UTC | |
|
Re: coding question
by oiskuu (Hermit) on Jan 04, 2014 at 19:46 UTC |