Chapter 2. Building Blocks
This chapter serves as a refresher on some fundamentals concepts.
How fast could an algorithm run? How does it fare when you have ten input elements versus a million? To answer such questions, we need to be aware of the notion of algorithmic complexity, which is expressed using the Big O notation. An O(1) algorithm is faster than O(logn), for example.
What is this notation? It talks about measuring the efficiency of an algorithm, which is proportional to the number of data items, N, being processed.
This chapter starts with a look at the O notation. Space/time trade-off is another important aspect of algorithm design. Let's look at a dynamic programming problem to better understand this fundamental notion.
Next, we will ...
Get Learning Functional Data Structures and Algorithms 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.