#ifndef HASHTABLE_H
#define HASHTABLE_H
#include <iostream>
#include <string>

template <class T>
class HashTable
{
	//Our data in the linklist is stored in nodes
	//whichs contains data and next pointers
	struct Node
	{
		T element;
		Node* next;
	};

	//head pointer which points to the first node in the SLL
	Node* m_head;
public:
	SLL<T> numBuckets[26];

	HashTable(void);
	~HashTable(void);
	int Hash();
	void INSERT( T Value );
	void REMOVE( T Value );
	void FIND( T Value );
	void CLEAR();
	void PRINT();
	bool end();
};
#endif

template <class T> HashTable<T>::HashTable(void)
{

	m_head = 0;

}
template <class T> HashTable<T>::~HashTable(void)
{

}
template <class T> void HashTable<T>::INSERT( T Value )
{	
		for( int i = 0; i < 26; ++i )
		{
			if(Value[0] == 'a'+i)
			{
				numBuckets[i].addHead(Value);
			}
		}
}
template <class T> void HashTable<T>::REMOVE( T Value )
{
	for( int i = 0; i < 26; ++i )
		{
			if(Value[0] == 'a'+i)
			{
				numBuckets[i].FindAndRemove(Value);
			}
		}
}
template <class T> void HashTable<T>::FIND( T Value )
{
		for( int i = 0; i < 26; ++i )
		{
			if(Value[0] == 'a'+i)
			{
				numBuckets[i].Find(Value);
			}
		}
}
template <class T> void HashTable<T>::CLEAR()
{
	for( int i = 0; i < 26; ++i )
		{
			numBuckets[i].Clear();
		}
}

template <class T> void HashTable<T>::PRINT()
{
	for(int i = 0; i < 26; ++i)
	{
		numBuckets[i].Print();
	}
}
 template <class T> bool HashTable<T>::end()
 {
	for( int i = 0; i < 26; ++i)
	{
		if(numBuckets[i] == 0)
		{
			return false;
		}else
		{
			return true;
		}

	}
 }