O'Reilly logo

Learning Functional Data Structures and Algorithms by Raju Kumar Mishra, Atul Khot

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Summary

This was a whirlwind tour of the basics. We started with a look at the Big O notation, which is used to reason about how fast an algorithm could run. Next came the notion of space-time trade-off.

We saw how trading off some space by caching known results saves time; it avoids needless computations. We looked at pure functions and referential transparency and saw how pure functions are amenable to memoization.

We looked at the idea of effective constant time operations.

FP programs use collections heavily. We looked at some common collection operations and their complexities.

We noted how complexity changes in the face of immutability. Building all this ground will give us enough foothold to look at our next data structure, that is, lists. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required