searching and sorting learning objective searching and sorting are two of the most common operations in computer science searching refers to finding the position of value in collection of values sorting refers to arranging data in certain order the two commonly used orders are numerical order and alphabetical order in this we will discuss the different techniques of searching and sorting arrays of numbers or characters introduction to searching searching means to find whether particular value is present in an array or not if the value is present in the arraythen searching is said to be successful and the searching process gives the location of that value in the array howeverif the value is not present in the arraythe searching process displays an appropriate message and in this case searching is said to be unsuccessful there are two popular methods for searching the array elementslinear search and binary search the algorithm that should be used depends entirely on how the values are organized in the array for exampleif the elements of the array are arranged in ascending orderthen binary search should be usedas it is more efficient for sorted lists in terms of complexity we will discuss all these methods in detail in this section linear search linear searchalso called as sequential searchis very simple method used for searching an array for particular value it works by comparing the value to be searched with every element of the array one by one in sequence until match is found linear search is mostly used to search an unordered list of elements (array in which data elements are not sortedfor exampleif an array [is declared and initialized asint [{ }