logoalt Hacker News

zkmontoday at 9:37 AM1 replyview on HN

To give an example, we consider that binary search requires less work than a linear search. But there are costs and usecase considerations involved. Insertion of new recod need to use binary search to keep the data sorted. Also if the number of lookups is far less than number of records, the overall cost is more than appending and linear search. That's what I mean by by moving the complexity around.

A problem scenario doesn't have absolute characteristics. It's relative to your way of looking at it, and your definition of a problem.


Replies

short_sells_pootoday at 2:28 PM

You are right, but this doesn't mean that the amount of work is conserved as your original message implies. The correct statement would be that "algorithmic complexity is just one aspect of actual practical complexity and an algorithm with better algorithmic complexity can end up performing worse in reality due to practical considerations of the data and the processor doing the computations".