Chapter 2
Algorithm Analysis
An important part of learning about data structures is understanding their performance. There are at least two reasons:
Design should take performance into account. What might seem like a natural and easy to code design might be unacceptably slow.
Selection of a data structure for a particular task should also take performance into account.
As you will see, data structures often get fast performance for some operations by sacrificing the performance of others. Being aware of these tradeoffs is part of becoming a good software developer.
There are also two main aspects to algorithm performance: time and space. Time performance is simply how long it takes the algorithm to run, whereas space is concerned with how much ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access