1
80kviews
Write an algorithm to sort set of numbers in ascending order. For above problem in which cases time complexity is calculated.
1 Answer
| written 9.3 years ago by |
Algorithm:
Consider we are sorting three numbers in ascending order.
Steps:
Start.
Accept three numbers from user (a, b, c).
If a < b then goto step 4 else goto step 8.
If a < c then goto step 5 else goto step 7.
If b < c then goto …