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

Bubble sort

Bubble sort is one of the simplest and oldest algorithms. Each element is compared with the next element. If neither of the elements are in order, then the elements are swapped. Every element of the sequence is visited.

A water bubble moves to the surface. Does this have any relation with bubble sort? The simplicity of the bubble sort algorithm makes it the starting point to learn a sorting algorithm. Bubble sort is stable as two elements of equal values are never swapped with each other.

We are going to implement all the algorithm in persistent way. You might be thinking that, what is the meaning of persistant data structure? Persistent data structure always maintains its previous version after modification. We are going to use another ...

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