sbhat98 / Scala-Collections

My attempt at recreating common data structures (immutable and mutable) in Scala

Repository from Github https://github.comsbhat98/Scala-CollectionsRepository from Github https://github.comsbhat98/Scala-Collections

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)

About

My attempt at recreating common data structures (immutable and mutable) in Scala


Languages

Language:Scala 100.0%