C++ STL

Flat Map

Hi everyone In this tutorial we will talk about Flat Map So, What is Flat Map actually? Flat Map is an associative container of C++ STL that stores data in key–value pairs, just like map. Each key inside a flat map is unique, and the elements are kept sorted by key automatically. From the outside, […]

Flat Map Read More »

Multimap

Hi everyone In this tutorial we will talk about Multimap So, What is Multimap actually? Multimap is an associative container of C++ STL that stores data in key–value pairs, just like map. The elements are kept sorted by key automatically. The one big difference from map is that multimap allows duplicate keys. The same key

Multimap Read More »

Map

Hi everyone In this tutorial we will talk about Map So, What is Map actually? Map is an associative container of C++ STL that stores data in key–value pairs. Each key inside a map is unique, and the elements are always kept sorted by key automatically. Unlike vector or list, where we access elements by

Map Read More »

Pair

Hi everyone In this tutorial we will talk about Pair So, What is Pair actually? Pair is a simple container that stores two values (which may be of different data types) together as a single unit. The two values are stored side by side and can be accessed individually using .first and .second. Pair is

Pair Read More »

Deque

Hi everyone In this tutorial we will talk about Deque So, What is Deque actually? Deque stands for Double Ended Queue. Deque is a special type of queue where data can be inserted and removed at both ends.   Header File Inclusion for deque #include <deque> Declaration & Initialization Declaring an empty deque — deque

Deque Read More »

Queue

Hi everyone In this tutorial we will talk about Queue So, What is Queue actually? Queue is a First In First Out(FIFO) data structure. STL Queue also works the same way STL Queue container’s underlying data structure deque (Double Ended Queue)   Header File Inclusion for queue #include <queue> Declaration #include <queue> queue <int> fifoList;

Queue Read More »

Stack

Hi everyone In this tutorial we will talk about Stack So, What is stack actually? Stack is a Last In First Out(LIFO) data structure. STL Stack also works the same way STL stack container’s underlying data structure deque (Double Ended Queue)   Header File Inclusion for stack #include <stack> Declaration #include <stack> stack <int> lifoList;

Stack Read More »