1MB Sorting Explained
preshing.com
1MB Sorting Explained
1–10 of 11 posts
Re: 1MB Sorting Explained
#2Re: 1MB Sorting Explained
#3While I believe the author's approach is the correct one, I am very curious to see a proof that an arithmetic encoding will always fall within the 1MB limit. The pigeonhole principle guarantees an average of slightly less than seven bits per number, but it doesn't follow that a particular encoding will always consume nearly the same number of bits--especially for the worst case input. Prefix codes are useful, but not…
Re: 1MB Sorting Explained
#4While I believe the author's approach is the correct one, I am very curious to see a proof that an arithmetic encoding will always fall within the 1MB limit. The pigeonhole principle guarantees an average of slightly less than seven bits per number, but it doesn't follow that a particular encoding will always consume nearly the same number of bits--especially for the worst case input. Prefix codes are useful, but not…
Is the probability density actually uniform? Once all million numbers have been processed (which is the only case that matters - anything with This means that even in a worst-case input set, "low" delta values will be substantially more common than "high" ones.
Re: 1MB Sorting Explained
#5Earlier quoted context omitted.
Is the probability density actually uniform? Once all million numbers have been processed (which is the only case that matters - anything with This means that even in a worst-case input set, "low" delta values will be substantially more common than "high" ones.
I think in the worst case it can be uniform: you can have an average delta value of 100 where the values range uniformly from 0 to 200. I think that case is fine, as you can still encode 200 in less than eight bits, but I'm worried that some worst-case number spacing will waste bits in any encoding scheme chosen, and that wastage will be enough to ruin the result. You have to pick an encoding scheme in advance but yo…
Re: 1MB Sorting Explained
#6Re: 1MB Sorting Explained
#7Re: 1MB Sorting Explained
#8[deleted]
Re: 1MB Sorting Explained
#9[deleted]