Search the courses, subjects, tracks, games and features, or jump straight to a page.
3 cards from this section. Quick, good the night before a test.
What is the time complexity of finding the maximum in an array?
Think about how many elements you must check.
Explain what a recursive algorithm is in your own words.
Consider the breaking down of tasks over iterations.
What is the time complexity of the maximum-finding algorithm?
Consider how the algorithm processes each element.
True or False: Recursive algorithms always run faster than iterative algorithms.
Think about the overhead involved in recursion.
Given an array of n elements, how would you design an algorithm to find duplicates? Explain the logic.
Consider the time complexity when designing the algorithm.
Calculate how many moves are required in the Towers of Hanoi for n=4 disks. Provide the solution.
Use the recursive formula we discussed.
4 more questions in this section. Enroll free to practise them all.
Enroll free