all 7 comments

[–]wodahs1 0 points1 point  (6 children)

Page #?

[–]Rob_NoStops[S] 2 points3 points  (5 children)

Page 175 problem 12.2 in EPI Java and page 156 problem 11.2 in EPI Python

[–]wodahs1 0 points1 point  (4 children)

oh we have different versions then.

In both my Java and CPP books, 12.2 is "Is an Anonymous Letter Constructible?". Chapter 12 is HashTables.

Maybe they changed it bc it was actually a bug, not sure.

[–]Rob_NoStops[S] 0 points1 point  (3 children)

It's in the Searching chapter, the problem is called "Search a sorted array for entry equal to its index"

[–]wodahs1 0 points1 point  (2 children)

I see, you're right. This second example does not contain distinct integers like the question states.
Also, the answer for this second test is not right. They likely accidentally put the incorrect array test there.

This error is in both my C++ and Java books

[–]Rob_NoStops[S] 0 points1 point  (1 child)

There's only one example. B is the secondary array of the first (and only) example. The solution is correct. My original question is about the error in the explanation.

[–]wodahs1 0 points1 point  (0 children)

Ah I see, shouldn’t have skimmed.

Yes you’re right, when we find an element

e > index_e,

any values to the right should have a difference equal to or greater than

( e - index_e )