00001 template <class Key, class T> 00002 class bstmap 00003 { 00004 typedef map<Key, T> Self; 00005 00006 public: 00007 typedef Key key_type; 00008 typedef T data_type; 00009 typedef pair<const Key, T> value_type; 00010 typedef unsigned int size_type; 00011 typedef int difference_type; 00012 00013 public: 00014 class iterator { 00015 // your iterator definition goes here 00016 }; 00017 class const_iterator { 00018 // like iterator, but points to a const 00019 }; 00020 00021 public: 00022 // default constructor to create an empty map 00023 bstmap() {} 00024 00025 // overload copy constructor to do a deep copy 00026 bstmap(const Self& x) {} 00027 00028 // overload assignment to do a deep copy 00029 Self& operator=(const Self& x) {} 00030 00031 // accessors: 00032 iterator begin() {} 00033 const_iterator begin() const {} 00034 iterator end() {} 00035 const_iterator end() const {} 00036 bool empty() const {} 00037 size_type size() const {} 00038 00039 // insert/erase 00040 pair<iterator,bool> insert(const value_type& x) {} 00041 void erase(iterator pos) {} 00042 size_type erase(const Key& x) {} 00043 void clear() {} 00044 00045 // map operations: 00046 iterator find(const Key& x) {} 00047 const_iterator find(const Key& x) const {} 00048 size_type count(const Key& x) const {} 00049 T& operator[](const Key& k) {} 00050 00051 };