Searching And Sorting Algorithm !!!

 SEARCHING ALGORITHMS

Searching algorithms are designed to check for an element or retrieve an element from any data structure where it is stored.

Base on the type of search operation, these algorithms are generally classified into two categories :

1. Sequential Search - In this, the list or array is traversed sequentially and every element is checked. For example - Linear search.

2. Binary Search - These algorithms are specially designed for searching in sorted data structures. These types of algorithms are much more efficient that Linear Search as they repeatedly target the center of the search structure and divide the search space into half. Ex- Binary Search.


SORTING ALGORITHMS

A sorting algorithm is used to re-arrange a given array or list elements according to a comparison operator on the elements. The comparison operator is used to decide the new order of element in the respective data structure.

For example :

(Input)                   (Output)

codingwithsagar -- aacdgghiinorstw

The above list of characters in the increasing order of their ASCII values. That is , the character with lesser ASCII value will be placed first than the character with higher ASCII value.


If you have reached till here , Thank you very much for reading this blog. Have a nice day !!!

Post a Comment

Please give us your valuable feedback !!!

Previous Post Next Post