/    /  Data Structures-Searching vs Sorting

Searching vs Sorting

 

Searching algorithms check elements or retrieve an element from a data structure. 

Sorting algorithms arrange data in a specific format, the most common formats being numerical and lexicographical. 

Some real-life examples of sorting are:

  1. Telephone directory
  2. Dictionary

 

SearchingSorting
It is used to retrieve elements from any data structure.It is used to arrange the data of a list or an array in a particular order.
The time complexity is O(N).The time complexity is O(N2). 
We can classify it into two categories: sequential search and interval search.We can classify it into two categories: internal sorting and external sorting. 
Examples: Linear search and Binary search.Examples: Bubble Sort, Insertion Sort, Selection Sort, Merge Sort, Quick Sort, etc.

 

Reference

Searching vs Sorting