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

Chapter 13. Sorting

In a chaotic environment, we look for events that are ordered and follow some rules in order to understand them. An ordered environment also helps in searching and choosing elements according to our requirements for a specific purpose.

Sorting can be in an increasing order (not decreasing when the data list has duplicate elements), and it can be in a decreasing order too. Remember the queue of students in school in the increasing order of height in parades, sorting a deck of cards to get the required card in a shorter time while playing cards?

A sorting algorithm arranges the elements of a collection in some order, generally, in either increasing or decreasing order. A sorting algorithm requires the comparison of elements and ...

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