Question: Consider the worst-case according to the input data and show the output step by step for the Selection sort and Heap sort. ( Each demonstration
Consider the worst-case according to the input data and show the output step by step for the Selection sort and Heap sort.
(Each demonstration will carry 10 marks for the worst case.)
n.b: It's a theoretical question. not programming.
Step by Step Solution
3.48 Rating (158 Votes )
There are 3 Steps involved in it
Answer The worst case for insertion sort will occur when the input list is in decreasing order To insert the last element we need at most n 1 n1 n1 comparisons and at most n 1 n1 n1 swaps In computer ... View full answer
Get step-by-step solutions from verified subject matter experts
