Károly joins us to improve our sorted array implementation from episode #35 using binary search. We benchmark both implementations to learn about their real-world performance.
In this final episode of our collection series, we make our custom IndexSet collection type conform to the Collection protocol, implementing a custom index type along the way.
In this episode, we make a custom collection conform to Sequence. This allows us to efficiently iterate over the elements, and we gain all the useful functionality of Sequence.
We show how to make an extension on array available to other collections: first, we implement it for array slices, then we implement it as a protocol extension for all collections.