Search the courses, subjects, tracks, games and features, or jump straight to a page.
2 cards from this section. Quick, good the night before a test.
What is the time complexity of finding a maximum in an array with n elements?
Think about how many comparisons you need to make.
What does O(2^n) represent in terms of algorithm complexity?
Consider how the size of the input affects the time taken.
What is the complexity class of finding the maximum in an array?
Think about the number of iterations needed.
Which of the following is NOT a characteristic of a recursive function?
What must a recursive function always have?
If you increase the number of disks in the Towers of Hanoi from 3 to n, express how the number of moves would increase.
Consider how each disk contributes to the total moves.
Create a recursive algorithm to calculate the factorial of a number and analyze its time complexity.
What does each function call reduce to?
5 more questions in this section. Enroll free to practise them all.
Enroll free