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

Sorting is used to solve many complex problems. Sorted data aids searching algorithms too. We discussed some very useful sorting algorithms, such as bubble sort, selection sort, insertion sort, merge sort, and quick sort. Every sorting algorithm has its own complexity.

We discussed bubble sort. Bubble sort is one of the earliest developed sorting algorithms. We implemented it in Scala.

After bubble sort, we moved on to selection sort, where in every pass, a small element is selected and put in a sorted list. Here, we found that in every pass, only one exchange is done, but the number of comparisons will be the number of unsorted elements.

The simplicity of insertion sort touched everyone. It uses two subsequences: one sorted and one unsorted. ...

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