Chapter 3. Need for speed: Time efficiency

This chapter covers

  • Comparing the performance of common data structures, including lists, sets, and trees
  • Evaluating worst-case performance and average long-run performance of a given data structure
  • Focusing the computational load on a specific method of a class, or spreading it on all methods

Achieving the maximum possible speed for a given computational task has fascinated programmers since the ancient times of punch-card programming. Indeed, you might say that a large part of computer science itself was born to satisfy this urge. In this chapter, I’ll present three different container implementations that optimize speed in different ways. Why three? Can’t I just present you with the best one? The ...

Get Seriously Good Software 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.