
- DSA using Java - Home
- DSA using Java - Overview
- DSA using Java - Environment Setup
- DSA using Java - Algorithms
- DSA using Java - Data Structures
- DSA using Java - Array
- DSA using Java - Linked List
- DSA using Java - Doubly Linked List
- DSA using Java - Circular Linked List
- DSA using Java - Stack
- DSA - Parsing Expressions
- DSA using Java - Queue
- DSA using Java - Priority Queue
- DSA using Java - Tree
- DSA using Java - Hash Table
- DSA using Java - Heap
- DSA using Java - Graph
- DSA using Java - Search techniques
- DSA using Java - Sorting techniques
- DSA using Java - Recursion
- DSA using Java Useful Resources
- DSA using Java - Quick Guide
- DSA using Java - Useful Resources
- DSA using Java - Discussion
DSA using Java - Sorting techniques
Sorting refers to arranging data in a particular format. Sorting algorithm specifies the way to arrange data in a particular order. Most common orders are numerical or lexicographical order.
Importance of sorting lies in the fact that data searching can be optimized to a very high level if data is stored in a sorted manner. Sorting is also used to represent data in more readable formats. Some of the examples of sorting in real life scenarios are following.
Telephone Directory − Telephone directory keeps telephone no. of people sorted on their names. So that names can be searched.
Dictionary − Dictionary keeps words in alphabetical order so that searching of any work becomes easy.
Types of Sorting
Following is the list of popular sorting algorithms and their comparison.
Sr.No | Technique & Description |
---|---|
1 |
Bubble Sort Bubble sort is simple to understand and implement algorithm but is very poor in performance. |
2 |
Selection Sort Selection sort as name specifies use the technique to select the required item and prepare sorted array accordingly. |
3 |
Insertion Sort Insertion sort is a variation of selection sort. |
4 |
Shell Sort Shell sort is an efficient version of insertion sort. |
5 |
Quick Sort Quick sort is a highly efficient sorting algorithm and is based on partitioning of array of data into smaller arrays. |
6 |
Sorting Objects
Java objects can be sorted easily using java.util.Arrays.sort() |