CPP STL Tutorial : C++ Min/Max operation that can be performed on containers

min : It will return the smallest max : It will return the largest minmax  : It will return smallest and largest elements min_element : It will return smallest element in range max_element : It will return largest element in range minmax_element  : It will return smallest and largest elements in range To use these […]

CPP STL Tutorial : C++ Heap operation that can be performed on containers

To use these heap operations, below header should be included: #include <algorithm> push_heap : It will push element into heap range pop_heap : It will pop element from heap range make_heap : It will make heap from range sort_heap : It will sort elements of heap is_heap   : It will test if range is […]

CPP STL Tutorial: C++ Sorting operation that can be performed on containers

Below are some of the sorting operations that can be performed on STL containers. sort : Sort elements in range stable_sort : Sort elements preserving order of equivalents partial_sort : Partially sort elements in range partial_sort_copy : Copy and partially sort range is_sorted   :Check whether range is sorted is_sorted_until  : Find first unsorted element […]

CPP STL Tutorial : C++ Partitions operation algorithms

Below are the functions that are used for partition operations: is_partitioned [C++11] : Test whether range is partitioned partition : Partition range in two stable_partition : Partition range in two – stable ordering partition_copy [C++11] : Partition range into two partition_point [C++11] : Get partition point #include <iostream> #include <unordered_map> #include <algorithm> //for more tutorials […]

CPP STL Tutorial : C++ Modifying sequence operations

Below are the some of the member functions for modifying operations: copy : It is used to copy range of elements copy_n  : It is used to copy elements move   : It is used to move range of elements move_backward : It is used to move range of elements backward replace : It is […]

CPP STL Tutorial : C++ Non modifying sequence operation algorithms

Below are the operations that are used to perform on STL containers. Most of the functions are function template. Hence they can be used to work with primitive and also user defined data types. To use these algorithms, below header should be included: #include <algorithm> all_of        : Test condition on all elements […]

CPP STL Tutorial : C++ std::priority_queue and it’s operations.

In this chapter we shall learn about: 1. priority_queue introduction. 2. priority_queue operations. 3. priority_queue member declaration. 4. priority_queue member functions 1. priority_queue introduction. 1. priority_queue is a type of container adapter. 2. It supports FIFO [First In First Out]. 3. FIFO means, that the elements are inserted first will be removed first. Below is […]

CPP STL Tutorial : C++ std::queue and it’s operations.

In this chapter we shall learn about: 1. queue introduction. 2. queue operations. 3. queue member declaration. 4. queue member functions 1. queue introduction. 1. queue is a type of container adapter. 2. It supports FIFO [First In First Out]. 3. FIFO means, that the elements are inserted first will be removed first. Below is […]

CPP STL Tutorial : C++ std::stack and it’s operations.

In this chapter we shall learn about: 1. stack introduction. 2. stack operations. 3. stack member declaration. 4. stack member functions 1. stack introduction. 1. stack is a type of container adapter. 2. It supports LIFO [Last In First Out]. 3. LIFO means, that the elements are inserted from the top and removed from the […]

CPP STL Tutorial : C++ std::unordered_multimap and it’s operations.

In this chapter we shall learn about: 1. unordered_multimap introduction. 2. unordered_multimap declaration. 3. unordered_multimap member function to get the Capacity. 4. unordered_multimap member function to iterate over elements 5. unordered_multimap member function for element access 6. unordered_multimap member function for element lookup 7. unordered_multimap member function for element modifiers 8. unordered_multimap member function to […]