Maps -- Chapter 16 + Hash_maps.

	What containers have we seen in this class so far?

16.1 Idea:
A map takes Keys and links them to a Value.
	map : Key->Value
A multimap takes Keys and links them to many Values.
	multimap: Key -> set(Value)

(or you can do them explicitly: map<Key, set<Value> >)

The class of Key must have a comparison 'less' operator.
Values can be of any type.

Maps and the UML (not on final)
	Do not fit very well.
	At the conceptual level
		you probably don't need to distinguish containers.
	The UML does have Qualified Associations that a like maps,
	but each has an attribute name as a key.
Maps are sets of pairs!
class pair
  is part of the <utility> STL library.

16.2 Sample Programs
	Telephone directory
		page 390:  not "long integer" but "long int"!
	Silly Sentences/grammars
		page 394, top line: incredible grammarType
			map< string, vector< list< string > > >
		Useful for text and for working on code.

16.3  class map
	page 399 talks of 'map<T>' it is map<X, Y> etc.
	Notice the speeds of the operations.
	Notice that m[k] lets us treat a map as an array/vector.
		(book 16.3.4, p400 is wrong to use map_three::value_type)
		find begin end...
	search (find) and count

Here is the most complex thing I've done with maps and sets
recently (not on quiz or final.... just because I'm proud of it)
(The theory is in

Note:  Certain algorithms work well on maps.
Don't forget to use an inserter to insert pairs into a
map.  Iterators overwrite the existing values (if it exists).

16.4 Example Implementation
	Just a special set of pairs....   The math rules here.
	No more needed for final.
	You'd need to fix 'iterator' in the books code.

There is a non standard variation on the STL map called the hash_map.
	hash-map: a container to add to the STL
		Stroustroup pages 497-504
	We have it in our STL library.

Works like a map but doesn't use a tree structure.  Gives very
fast access if you can waste some space.

Use Hash_maps for unordered data 
 and when space is cheap and time is tight

Simple to use with simple data types
To store objects with a special key you need to define a class that knows 
how to hash your special key.  Precisely like the following code:

We will talk about implementing hash tables next time.
Study: special handout on Hashing plus
	chapter 17.1, 17.2, 17.3, not 17.4(bucket sort), 
	Chapter 17.4.3 radix sorting, 17.5 17.6,...
   	chapter 20.5.1,.2 open table hashing