Section 12.1 Eytzinger Layout
usefulcat opened this issue · 2 comments
usefulcat commented
When I run the eytzinger() function in that section, it produces the following layout in array t (given 0-9 in array a): 6 3 8 1 5 7 9 0 2 4. But in the text and graphics for that section the 7 and 8 are swapped.
AFAICT the text and graphics are incorrect (for example, 8 can't be the left child of 7 because 8 is greater than 7).
RReverser commented
Ran into the same issue, thought I'm going crazy and my implementation is incorrect. Sigh.
gitonthescene commented
Also it looks like the eytzinger
function only lines up with the description of shuffling the evens to the back when you have 2^k-1 or 2^k-2 elements. It doesn’t for the n=10 example given. It feels like this might be worth a mention.