Packages

class SequentialSearchTable[Key, Value] extends BasicSymbolTable[Key, Value]

This class implements an unordered symbol table of generic key/value pairs.

This implementation uses a singly-linked list and sequential search. It relies on the equals method to test whether two keys are equal. It does not call either the compare or hashCode method.

The put and delete operations take linear time; the get and contains operations takes linear time in the worst case. The size, and is-empty operations take constant time. Construction takes constant time.

Adapted from the book Algorithms 4 by R. Sedgewick and K. Wayne.

See also

Section 3.1 of Algorithms, 4th Edition

Algorithms, 4th edition by Robert Sedgewick and Kevin Wayne, Addison-Wesley Professional, 2011, ISBN 0-321-57351-X. http://algs4.cs.princeton.edu

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SequentialSearchTable
  2. BasicSymbolTable
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. def apply(key: Key): Value

    returns

    value paired with key

    Definition Classes
    SequentialSearchTableBasicSymbolTable
    Exceptions thrown

    NoSuchElementException if key is not in table

  5. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  6. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  7. def contains(key: Key): Boolean
    Definition Classes
    BasicSymbolTable
  8. def delete(key: Key): Unit

    Removes key/value pair from table.

    Removes key/value pair from table.

    Definition Classes
    SequentialSearchTableBasicSymbolTable
    Exceptions thrown

    NoSuchElementException if key is not in table

  9. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  10. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  11. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  12. def get(key: Key): Option[Value]
    Definition Classes
    BasicSymbolTable
  13. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
  14. def getOrElse(key: Key, default: ⇒ Value): Value
    Definition Classes
    BasicSymbolTable
  15. def hashCode(): Int
    Definition Classes
    AnyRef → Any
  16. def isEmpty: Boolean
    Definition Classes
    BasicSymbolTable
  17. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  18. def keys(): Iterable[Key]

    returns

    all keys in the table

    Definition Classes
    SequentialSearchTableBasicSymbolTable
  19. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  20. final def notify(): Unit
    Definition Classes
    AnyRef
  21. final def notifyAll(): Unit
    Definition Classes
    AnyRef
  22. def size: Int
  23. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  24. def toString(): String
    Definition Classes
    SequentialSearchTableBasicSymbolTable → AnyRef → Any
  25. def update(key: Key, value: Value): Unit

    Inserts key/value pair into table.

    Inserts key/value pair into table. Replaces value if key is already there.

    Definition Classes
    SequentialSearchTableBasicSymbolTable
  26. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  27. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  28. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from BasicSymbolTable[Key, Value]

Inherited from AnyRef

Inherited from Any

Ungrouped