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.
Define an algorithm.
Think about how we break down tasks.
What is the time complexity of finding the maximum element in an array?
Think about how many times we check the elements in a loop.
What is the time complexity of finding the maximum element in an array?
Think about how many comparisons you are making.
True or False: The Tower of Hanoi has linear time complexity.
Think about how the number of moves increases with disks.
Design an algorithm that finds the second largest number in an array and analyze its time complexity.
Consider how you can keep track of the largest and second largest simultaneously.
Explain how you would improve the distinct-check algorithm using a hash set.
What advantages do hash structures offer over nested loops?
7 more questions in this section. Enroll free to practise them all.
Enroll free