Ejemplo n.º 1
0
int main(){
	HT myTable;
	cout<<"Inserting..."<<endl;
	myTable.insert(2,"mike");
	myTable.insert(12,"kalgecin");
	myTable.insert(52,"michael");
	//cout<<"1"<<endl;
	myTable.insert(59,"yasin");
	//cout<<2<<endl;
	myTable.insert(51,"frank");
	//cout<<3<<endl;
	cout<<"Done inserting"<<endl;
	try{
		cout<<"kalgecin is "<<myTable.find("kalgecin")<<endl;
		cout<<"69 is "<<myTable.find(59)<<endl;
	}catch(string s){
		cout<<s<<endl;
	}
	return 0;
}
Ejemplo n.º 2
0
 /** Finds an element in the set.
  *
  *  @param item the item to look for
  *
  *  @return a #const_iterator pointing to the item, or @p end() if the
  *  item cannot be found in the set.
  */
 iterator find( const value_type& item ) const 
 { return m_ht.find( item ); }
Ejemplo n.º 3
0
 /** Finds an element whose key is @a key
  *
  *  @param key the key of the item
  *
  *  @return a #const_iterator pointing to the item, or @p end() if the key
  *  cannot be found in the map.
  */
 const_iterator find( const key_type& key ) const
 { return m_ht.find( key ); }