Prefix sum binary search
You're writing a custom vertical layout (a UICollectionViewLayout subclass) where every cell has a different height. layoutAttributesForElements(in rect:) gets called on every scroll, and iterating 20,000 cells each time stutters. Which data structure and algorithm find the visible cell range in O(log n)?