Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

And if you don't know exactly how many pages there are? Normaly you would just do binary search.


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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: