Hacker News new | ask | show | jobs
by vincnetas 1928 days ago
And if you don't know exactly how many pages there are? Normaly you would just do binary search.
1 comments

If pages are numbered, the largest page number is still on last page. Just look there.

Or alternatively: The first step of your binary search is to look at the page number on the flip side of page 1 and determine to flip the stack or not.