Question
11. Short Questions: a) Given 1000 data in random order, what will be the runtime if you use Merge Sort to sort them? b) Given
11. Short Questions:
a) Given 1000 data in random order, what will be the runtime if you use Merge Sort to sort them?
b) Given the following three sets of data:
i) 20, 18, 16, 14, 12, 10, 8, 6, 4, 2, 0
ii) 0, 2, 4, 6, 8, 10, 12, 14, 16, 18, 20
iii) 0, 4, 2, 10, 8, 16, 14, 12, 20, 18, 6
Out of Selection Sort, Insertion Sort, Merge Sort and Quick Sort, which algorithm or algorithms will be best suited for each set (in terms of shortest runtime), and give corresponding runtime.
c) Explain the three steps of Divide and Conquer algorithm using the example of Merge Sort.
d) Apart from Merge Sort, give any other two examples where the Divide and Conquer Principle is used,
f) Explain why Selection Sort runtime does not depend on initial data arrangements?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started