Searching and sorting are the two vividly used tasks in our daily life. Searching and sorting is applied on different things. Search for a book in library is one real time example of searching. Arranging the books in self based on size or frequency of used one example of sorting.
An attempt to find the existence of an item in a list of items is called as Searching. It means finding an item in
a group of items. For example there many pens of different colors are kept in a box. The task of Finding a pink color
pen in the box is called as searching. We can do the searching in different ways.
In our course of searching we find an element in an array. An Array consists of some elements. The element which
we want to search is called as 'Search Key'. The search key may exist in the array or may not exist.
If it exists we will return the position of the element else we will return "Element is not found" as result.
We discuss two sorting algorithms here
1. Linear Search
2. Binary Search
Arranging items in order is called as sorting. Arranging elements of array or structure in order is called
as sorting. There are different types of sorting algorithms are present.
We discuss the following sorting algorithms.
1. Selection Sort
2. Bubble Sort