Re: Encoding/decoding ranges of unsigned integers...



d|dq wrote:
Here is the description of a problem:

Assume you have n integer ranges: [i, j], [k, l], [m, n]...

There is no particular order on the sequence of ranges.
There is no gap in any of the ranges.

Is there a smart way to encode these ranges into a representation that would be both compact and efficient to encode/decode.

Before I go about and re-invent the wheel, I would like to know if there is a well known algorithm to accomplish this.

i don't know if this is applicable in your case.
But tag tree coding is quite a common method to encode large arrays of integers. It is for example used in JPEG2000 to encode the packet headers.
.




Relevant Pages