SORTING ARRAY IN C++
Definition:
Sorting is the process of putting data in order; either
numerically or alphabetically. It is often necessary to arrange the elements in
an array in numerical order from highest to lowest values (descending order) or
vice versa (ascending order).
What is sorting ?
Sorting is the process of placing elements from a collection in some kind
of order. For example, a list of words could be sorted
alphabetically or by length. ... Like searching, the efficiency of a sorting algorithm
is related to the number of items being processe
A sorted array is an array in which each of the elements are
sorted in some order such as numerical, alphabetical etc. There are many
algorithms to sort a numerical array such as bubble sort, insertion sort,
selection sort, merge sort, quick sort, heap sort etc. More details about
sorting the array using selection sort are given below.
The selection sort is a sorting method that yields a sorted array.
It does so by repeatedly finding the smallest element in the array and
interchanging it with the element at the starting of the unsorted part.
A program that implements a sorted array using selection sort is
given as follows.
Comments
Post a Comment