Organize given number in ascending order Assignment Help

Assignment Help: >> Algorithms for Problem Solving >> Organize given number in ascending order

Organize numbers in ascending order

 Organize numbers in ascending order and descending order is called sorting. So, the sorting is the process of arranging the set of numbers in the ascending or descending order.

Example:

Suppose we take 10 numbers from the keyboard and store at different location of an array.

a[0]        a[1]        a[2]        a[3]        a[4]        a[5]        a[6]        a[7]        a[8]        a[9]

Unsorted Array:               12           15           13           16           17           3              19           14           16           10

Sorted Array:                     3              10           12           13           14           15           16           16           17           19

Algorithm:

Step 1: Start

Step 2: Read the set of numbers from the keyboard and store it in the array of a. Such as a[0],a[1],a[2],a[3],.........,a[n].

Step 3: Find the smallest number in the given or unsorted array.

Step 4: Exchange i.e. interchange smallest value of the array element and store it in first element of the unsorted part of array.

Step 5: Repeat step 3 and step 4 until all the element in the array are arranged in the ascending order.

Step 6: Stop.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd