Question
(a) (8 pts) Assume that the given list has been sorted in ascending order. Give a recursive Divide-and-Conquer final search algorithm (in pseudocode) which first
(a) (8 pts) Assume that the given list has been sorted in ascending order. Give a recursive Divide-and-Conquer final search algorithm (in pseudocode) which first tests the element at position n/4 for equality with some value x, and then possibly checks the element at position 3n/4. The result is either discovering x or reducing the set size to a fraction of the original. (b) (6 pts) Give the recurrence relations of final search algorithm. (c) (9 pts) Give the best-case, worst-case and average-case complexity of final search algorithm? No Justifications needed. Best-case Complexity Worst-case Complexity Average-case Complexity
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