Class BinarySearchTree<Key extends Comparable<Key>,Value>

java.lang.Object
dsa.lib.DSAObject
dsa.lab07.solutions.BinarySearchTree<Key,Value>
Type Parameters:
Key - the key type
Value - the value type
All Implemented Interfaces:
Container<MapItem<Key,Value>>, Map<Key,Value>, OrderedMap<Key,Value>, dsa.lib.DSAInterface, Iterable<MapItem<Key,Value>>
Direct Known Subclasses:
AVLTree, AVLTree

public class BinarySearchTree<Key extends Comparable<Key>,Value> extends dsa.lib.DSAObject implements OrderedMap<Key,Value>
A binary search tree.
  • Field Details

  • Constructor Details

    • BinarySearchTree

      public BinarySearchTree()
      Construct an empty binary search tree.
    • BinarySearchTree

      public BinarySearchTree(Iterable<MapItem<Key,Value>> items)
      Construct a binary search tree containing the given items.
      Parameters:
      items - the items
    • BinarySearchTree

      public BinarySearchTree(Iterable<MapItem<Key,Value>> items, int size)
      Construct a binary search tree containing the given items more efficiently than BinarySearchTree(Iterable).
      Parameters:
      items - the items
    • BinarySearchTree

      @SafeVarargs public BinarySearchTree(MapItem<Key,Value>... items)
      Construct a binary search tree containing the given items.
      Parameters:
      items - the items
    • BinarySearchTree

      public BinarySearchTree(DynamicArray<MapItem<Key,Value>> items)
      Construct a binary search tree containing the given items.
      Parameters:
      items - the items
  • Method Details