algorithmica icon indicating copy to clipboard operation
algorithmica copied to clipboard

Section 12.1 Eytzinger Layout

Open usefulcat opened this issue 3 years ago • 2 comments

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).

usefulcat avatar Jan 23 '23 14:01 usefulcat

Ran into the same issue, thought I'm going crazy and my implementation is incorrect. Sigh.

RReverser avatar Feb 08 '25 23:02 RReverser

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.

gitonthescene avatar Feb 09 '25 08:02 gitonthescene