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 element in an array?
Consider how many times you need to look through the array.
What is the time complexity of a nested loop that iterates n times?
Think about how the outer loop interacts with the inner loop.
What is the time complexity of finding the maximum element in an array?
Consider how many iterations are required.
True or False: A recursive algorithm always has a higher time complexity than its iterative counterpart.
Think about specific examples of algorithms.
Devise an algorithm for finding the lower and upper bounds of a sorted array using binary search. Detail the time complexity.
Consider the properties of binary search.
Given a set of n unique items, derive the recurrence relation for arranging these items, and find its complexity.
Think of arrangements: for each item, the others are arranged around it.
4 more questions in this section. Enroll free to practise them all.
Enroll free