List being widely used in Data Structure, has its own importance. List is used to store elements with its own defined methods. Let’s see how we can sort data stored in List. To learn more about List click here.
Sort a List containing Integer
To sort an List, use Collections.sort() method. …
Quick sort which by name conveys sorting done quickly. It is based on Divide and Conquer as termed as Partition exchange sort. Though this sorting algorithm is not stable but it requires very less additional space and is fast. To follow its definition of divide and conquer, it first selects a pivot value and with the assistance of Pivot value list is splitting into three parts as mentioned below-
- Elements lesser than Pivot value
- Pivot Value
- Elements greater than Pivot value