C++ STL

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 »

Priority Queue

Hi everyone In this tutorial we will talk about Priority Queue So, What is Priority Queue actually? Priority Queue is a special type of queue where each element has a priority associated with it. Elements with higher priority are served before elements with lower priority, regardless of their insertion order. STL Priority Queue also works

Priority Queue 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 »

List

Hi Everyone In this tutorial we will talk about List. So, what is list actually? List is a doubly linked list container in C++ STL. List is a sequential container of STL. Since, its underlying data structure is doubly linked list, list has a dynamic property regarding memory allocation. Header File Inclusion for list #include

List Read More »

Vector

Hi Everyone ✋ In this tutorial we will talk about Vector. So, what is vector actually? Vector is a dynamic array container of C++ STL. Vector is a sequential container of STL. Array data structure is great for random access. But it has a fixed size array limitation. In a dynamic array, we don’t have

Vector Read More »

Standard Template Library

Hi Everyone ✋ In this tutorial series we will talk about C++ STL in depth. STL stands for Standard Template Library. STL has four components Containers Iterators Algorithms Function Objects     Containers Containers are actually pre implemented data structures provided by C++ to use. These containers help us to write code efficiently without worrying

Standard Template Library Read More »