???????????????????map vs TreeMap????

????????????Java???б????????????Map?????????????????????????????????????TreeMap??HashMap????????????????????????????Ч????????????????????????Java??C++??STL?????map???????書??????Java?е?TreeMap??????HashMap????????н???C++????????????????????е?????C++???????????????????????????????????????????????hash_map??????????????STL?е?????????????

?????????????????????о?TreeMap??Java????map??C++?????????????????????????????????????????????????????????????????и?????????Щ???????????????????

????1????????????????????????????????Java??TreeMap???????????????????????????????????????C++?е?map????????????????????иü?????????????2???????????????????????????У???????Java????????????

public class MyTest {
         private static void testGet() {
             TreeMap<String??String> tm = new TreeMap<String??String>();
             tm.put("Hello"?? "World");
             if (tm.get("Hello1") == null)
                 System.out.println("Hello1 is NOT found.");
         }
   
         public static void main(String[] args) {
             TreeMap<Integer??Integer> tm = new TreeMap<Integer??Integer>();
             tm.put(5?? 10);
             tm.put(5?? 20);
             Set<Entry<Integer??Integer>> entries = tm.entrySet();
             Iterator<Entry<Integer??Integer>> it = entries.iterator();
           
             while (it.hasNext()) {
                 Entry<Integer??Integer> e = it.next();
                 System.out.printf("key = %d?? value = %d "??e.getKey().intValue()??e.getValue().intValue());
             }
         }
     }
     //The count of the TreeMap is 1
     //key = 5?? value = 20

??????????C++????????????

using namespace std;
     int main()
     {
         map<int??int> m;
         m.insert(make_pair(5??10));
         m.insert(make_pair(5??20));
         printf("The count of the map is %d. "??m.size());
         map<int??int>::iterator it = m.begin();
         for (; it != m.end(); ++it) {
             printf("key = %d?? value = %d "??(*it).first??(*it).second);
         }
         return 0;
     }
     //The count of the map is 1
     //key = 5?? value = 10

????????????????????????????????????????????????????C++?????????????е?Java????????????????????????????????????????????????????ж?ü???????????????????????м???????????????????????????????У???????????м????????????ü????????????????????????????????????????????????????????????????????????????????г?????????Ч???????????????????Щ?????????????C++????

using namespace std;
     int main()
     {
         map<int??int> m;
         m.insert(make_pair(5??10));
         map<int??int>::iterator it = m.find(5);
       
         if (it != m.end())
             m.erase(it);
         m.insert(make_pair(5??20));
         //?????????·??
         //if (it != m.end())
         //    it->second = 20;
         //else
         //    m.insert(make_pair(5??20));
       
         printf("The count of the map is %d. "??m.size());
         it = m.begin();
         for (; it != m.end(); ++it)
             printf("key = %d?? value = %d "??(*it).first??(*it).second);
         return 0;
     }
     //The count of the map is 1
     //key = 5?? value = 10