Question
a) Given a set of 200 unsorted data (i.e. N = 200). What would be the runtime if Bubble sort is used to sort them?
a) Given a set of 200 unsorted data (i.e. N = 200). What would be the runtime if Bubble sort is used to sort them?
b) What is the basic difference between an Iterative function and a Recursive function?
c) Given runtimes of two algorithms as below:
T1(N) = N2lgN and T2(N) =
Which algorithm will have shorter runtime, 1 or 2, give justifications.
d) Give examples of at least three algorithms based on Divide and Conquer principles.
e) Given the following data set:
12, 23, 29, 31, 41, 56, 71, 81, 91, 191
Which algorithm out of Insertion sort, quick sort and Merge sort will having shortest runtime and what will be that runtime?
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