Data Structures & AlgorithmsVery hardICPC regional · data structures
Problem: What is the purpose of a 'segment tree beats' structure?
- A. Finding the median of a stream
- B. Counting bits
- C. Range chmin and range sum with amortised bounds
- D. Sorting strings
Correct answer: C. Range chmin and range sum with amortised bounds
Segment tree beats handles range min-updates efficiently by tracking the top two values in each node.
More Coding Interview Problems questions
- Problem: What is the number of comparisons needed in the worst case to check whether a sorted array of n elements contains a given value…
- Problem: What is the greedy choice used in the 'minimum number of arrows to burst balloons' problem?
- Problem: Which problem is solved by the Gale-Shapley algorithm in O(n^2) time with preference lists?
- Problem: Which data structure supports adding a value to a prefix of an array and finding the first index whose value is at least x, each…
- Problem: What is the time complexity of computing the diameter of a tree with n vertices by two breadth-first searches?
- Problem: How many integers in [1, 1000] are divisible by both 4 and 9? Run the code. python print(sum(1 for x in range(1, 1001) if x % 4…