Map In C++ | STL C++


youtube ►
patreon ►

play list for smart pointers:
play list for STL:
play list for C++14:
play list for Threads In C++:
play list for C++ Interview Questions And Answer:
play list for C++ Tutoria For Beginners:
paly list for Design Patterns:
play list for Linked List Interview Questions:
play list for Data Structures:
play list for Type Casts:
paly list for Sorting Algorithms:

TOPIC: Map In C++

1. std::map is associative container that store elements in key value combination
where key should be unique, otherwise it overrides the previous value.
2. It is implement using Self-Balance Binary Search Tree (AVL/Red Black Tree) .
3. It store key value pair in sorted order on the basis of key (assending/decending).
4. std::map is generally used in Dictionay type problems.

#MapSTL #STLCpp #CppNuts


Xem thêm bài viết khác:


  1. Jake T 6 May, 2020 at 18:24 Reply

    Can you expand on the comparison of data within two different objects? You mentioned a function. value_comp is exclusively for comparisons within the same object? I am not sure where you were going with that.

  2. Yılmaz ALPEREN 6 May, 2020 at 18:24 Reply

    Hello Sir ! I didn't understand meaning of auto&ell : m . Anybody help me for explanation.

  3. Schoolroom9 6 May, 2020 at 18:24 Reply

    at 2:01 you said, same same cannot have different values, but at 13:14 how , the key Amit has different values. :/

  4. Mahesh K 6 May, 2020 at 18:24 Reply

    Thank you youtube algorithms for suggesting this video, just what I wanted, subscribed… liked…

  5. videofountain 6 May, 2020 at 18:24 Reply

    An alternative is Map.insert({"LilSyntax",888}) for your example… The argument is a simple example of std::initializer_list<T> … This is a briefer syntax. std::make_pair is not always necessary today.

  6. SenthilAndavan Palani 6 May, 2020 at 18:24 Reply

    I had a doubt but my program clarified .what if the key is string and the key Value is "aBC" "ABC" . Are these same or different and insert into the map.It is inserted

  7. SenthilAndavan Palani 6 May, 2020 at 18:24 Reply

    Simple and amazing

    1)map template structure 2)map<key,value> key should be unique. different way to insert the values in map a)Map.insert(std::make_pair(key,value)) b)Map.insert(std::pair<K,T>(key,value)) c)Map[key] ; in this case value will be default 3)How map is Internally implemented. self balance search tree how to traverse In-order 4) By default map is ordered in Ascending, If we want to sort in descending order we need to use map<int,string,greater<>>Map. You used vector as value. Value can be anything.Vector or map or any object. Probably, you could have included the time complexity of inserting the element although most people know it.

  8. Ms Babjan 6 May, 2020 at 18:24 Reply

    I am following ur videos, and they r really helpful.Thanks for that.
    But i want to ask u when r u uploading Data Structures videos?
    Kindly do it soon..👍

  9. Markus Buchholz 6 May, 2020 at 18:24 Reply

    Hello Rupesh! Generally speaking all your videos are very useful and carefully done! The content is also great. I am very glad of being the member if your channel. It will be also great to present, beside "the theory" some small projects to utilize the theory in practice. Anyway., please continue your channel. Keep fingers for you!

  10. aman bhardwaj 6 May, 2020 at 18:24 Reply

    That's a great insight☺️. Please cover the working of unordered_map/unordered_set also in next videos. Reason I am asking this because i have tried to understand about how the collisions are handled in these unordered associative containers but still not sure how it is done exactly. It will be great if you can give some insights, from the time complexity point of view also.

Leave a reply