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
2
3.2kviews

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 …

Create a free account to keep reading this post.

and 4 others joined a min ago.

Please log in to add an answer.