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.
Define the divide and conquer strategy in one sentence.
Think about how to tackle a large task.
What is an inversion in the context of rankings?
Consider how preferences can differ between two people.
What is the time complexity of the brute force method for counting inversions?
Consider how many comparisons are made.
True or False: Merge sort can be modified to count inversions.
Reflect on what happens when sorting two halves.
Given the rankings [3, 1, 4, 2] and [1, 4, 2, 3], calculate the number of inversions and explain each step.
Map each of the ranking pairs and see which are inverted.
Describe how you would implement a counting inversions algorithm from scratch, including planning for edge cases.
Think about how to handle empty or very small input lists effectively.
5 more questions in this section. Enroll free to practise them all.
Enroll free