English
Topic 10. Kotlin collections: lists, sets, maps, mutable and immutable collections
Goal: learn to choose arrays and collections according to the domain contract, traverse and modify them safely, work with keys, and separate internal data from external views.
Lecture contents
- Arrays — Arrays: size and element type · Example 1. A week of temperatures · Two-dimensional arrays
- The collection hierarchy and lists — The collection hierarchy · Read-only does not mean immutable · Lists and positional operations
- Sets and maps — Sets and equality · Maps: key, absence, and value
- Traversal, queues, and sorting — Safe traversal and modification · ArrayDeque as a stack and a queue · Sorting and choosing an implementation
- Case studies and design mistakes — Collection ownership in a domain class · Choosing a structure: a request queue · Collection checks that reveal design mistakes