Week 2: Recursive Algorithm Time Complexity Flashcards
What are activation records?
What information is stored when a new activation record is created?
What params are stored in the execution stack when the main function calls BinarySearch(L, x, 0, n-1)?
What are stored in each execution stack for each recursive call for the following binary search function?
What method is used to solve the time complexity of recursive algorithms?
What two cases are needed to compute the time complexity of binary search?
What is the base case for the following algorithm? Why?
Examine the following:
What is the amount of elements examined in the first recursive call made by the binary search algorithm?
What are the base case and recursive case for binary search in terms of time complexity?
What equation do you use to represent recursive algorithm time complexities?
Recurrence equation:
Base case + recursive case
What method do you use to solve recurrence equations for recursive time complexities?
Repeated substitution
Examine the following representations for linear search and bvinary search:
Examine and understand the repeated substitution method for binary search
Example of comparing orders: