logoalt Hacker News

fiddlerwoarooftoday at 6:25 AM1 replyview on HN

But how the data got sorted is irrelevant to the speed of the algorithm: for example, you could use binary search as part of an algorithm to find the insertion point of a new element in an always sorted data structure, meaning that sorting the data is never necessary.


Replies

zkmontoday at 7:38 AM

The overall journey matters. For example, for some flight journeys, the flight-time is only a fraction of the overall time taken by the journey, which could makes it faster if you use road or rail transport. Flight speed doesn't matter.

show 1 reply