As a general rule, we want our algorithms to work as efficiently as possible, which usually means that we want them to quickly solve the problem they are designed for using as few resources, such as memory or disk space, as possible. This is just a rule of thumb, of course, since we also need to factor in programmer time. If you need a problem solved a month from now and you have an algorithm that can solve the problem in two weeks and takes one week to implement, that is preferable over an algorithm that ...
4. Algorithmic Efficiency
Get Introduction to Computational Thinking: Problem Solving, Algorithms, Data Structures, and More now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.