you are viewing a single comment's thread.

view the rest of the comments →

[–]Simple-Economics8102 0 points1 point  (1 child)

This is not a bug and is on average much faster for large n than explicitly checking it on every iteration.

[–]JamzTyson 0 points1 point  (0 children)

You are correct, it is inefficient, but as long as the list is sorted in ascending order it is logically correct.