dsa

Data Structures & Algorithms - Spring 2018
Log | Files | Refs | README

HashTableInterface.java (741B)


      1 package lab12;
      2 public interface HashTableInterface<K,V> {
      3 
      4     public boolean tableIsEmpty();
      5     public int tableLength();
      6 
      7     public boolean tableInsert(K key, V value); //inserts  association (key,value) only if key is not already in HashTable and returns true; returns false if the key already has an associated value in HashMap and does not insert
      8 
      9     public boolean tableDelete(K searchKey); //deletes the key and its association from the HashTable if it is in the table and returns true; returns false if key is not in the HashTable
     10 
     11     public V tableRetrieve(K searchKey); //returns the value associated with searchkey in HashMap or null if there is no association
     12 
     13     public int hashIndex(K key);
     14 
     15 }  // end HashTableInterface
     16