Search the courses, subjects, tracks, games and features, or jump straight to a page.
4 cards from this section. Quick, good the night before a test.
What is the time complexity of finding the maximum element in an array?
Consider how many elements you have to check.
How do you determine if an array has distinct values?
Think about what happens with duplicates.
What is the time complexity for an iterative algorithm that runs in a single loop through n elements?
Think about how many comparisons you make.
The Towers of Hanoi problem has a time complexity of which of the following?
Recall how many moves you have to make based on disk numbers.
Propose a sorting algorithm and analyze its time complexity.
Consider divide and conquer strategies.
Devise a recursive function to calculate the factorial of a number n and discuss its time complexity.
Think about the base case and the recursive case.
6 more questions in this section. Enroll free to practise them all.
Enroll free