Index finite lists of positive integers: Difference between revisions

→‎{{header|jq}}: bijection and compactness
m (→‎{{header|jq}}: remove `unique`)
(→‎{{header|jq}}: bijection and compactness)
Line 586:
 
For example: 1 2 3 => 11 011 0011 => 110110011 => 110011011
 
Since the binary string so obtained is a positive integer,
it can be seen that the mapping implicitly defined here (between positive integers and
lists of positive integers) is in fact bijective, and is more compact
than the binary 'n 1s' encoding.
 
The Go implementation of jq and, as of version 1.6, the C
2,442

edits