Posts

Showing posts from July 20, 2022

What is Sorting and searching are fundamental operation in computer science engineering?

What is Sorting and Searching are fundamental operation in computer science engineering? What is Sorting?       Sorting refers to the operation of arranging data in some given order,such as increasing or decreasing with numerical data or alphabetically with character data. Let A be a list of n elements A1, A2,......An in memory. Sorting a refers to the operation of rearranging the contents of A so that they are increasing in order (numerical or lexicographically ), that is,so that                 A1<=A2<=A3<=...<=An Since A has n elements there are n!ways that the contents can appear in A. These way correspond precisely to the n! permutations of 1,2,......n . Accordingly each sorting algorithm must take care of these n! possibilities. What is searching?          Searching refers to the operation of finding the location of a given item in a collection of items.