Scala Collections
My attempt at recreating common data structures in Scala. Unit tests included.
Collections Completed
Average time complexities listed.
Immutable
-
Binary Search Tree
- add - O(log n)
- remove - O(log n)
- contains - O(log n)
- k-select/apply - O(log n)
-
List
- ::/prepend - O(1)
- add - O(n)
- reverse - O(n)
- head - O(1)
- tail - O(1)
Mutable
- LinkedList
- prepend/addToEnd - O(1)
- add - O(n)
- reverse - O(n)
- remove - O(n)