Maps in C++

Revision en2, by Leone_kyoya, 2022-12-23 11:32:48

Using maps in C++ is common but dangerous also. As for the question Link if we use map, then it may leads to TLE, but the same CODE will work if you use a vector or any other method for storing the count of the given elements. This is because map is a self-balanced BST(Balanced Binary Search Tree). and it takes O(LOGN) time to insert and search element. So always be careful while using the map

Tags maps

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Leone_kyoya 2022-12-23 11:32:48 2 Tiny change: 'then it map leads to ' -> 'then it may leads to '
en1 English Leone_kyoya 2022-12-23 11:32:09 461 Initial revision (published)