Ayush Gupta has Published 530 Articles

multiset max_size() in C++ STL with Examples

Ayush Gupta

Ayush Gupta

Updated on 06-Apr-2020 13:55:35

136 Views

In this tutorial, we will be discussing a program to understand multiset max_size() in C++ STL.The function max_size() returns the maximum number of elements a given container can hold.Example Live Demo#include using namespace std; int main(){    multiset s;    s.insert(10);    s.insert(13);    s.insert(13);    s.insert(25);    s.insert(24);   ... Read More

multiset size() in C++ STL with Examples

Ayush Gupta

Ayush Gupta

Updated on 06-Apr-2020 13:53:28

121 Views

In this tutorial, we will be discussing a program to understand multiset size() in C++ STL.The function size() returns the number of elements present into a given container.Example Live Demo#include using namespace std; int main(){    multiset s;    s.insert(10);    s.insert(13);    cout

order_of_key() in C++

Ayush Gupta

Ayush Gupta

Updated on 06-Apr-2020 13:51:29

822 Views

In this tutorial, we will be discussing a program to understand order_of_key() in C++.The function order_of_key() takes in a key and returns the number of elements which are less than the key provided as parameter in an ordered set.Example Live Demo#include using namespace std; #include #include #include ... Read More

Iterator Invalidation in C++ program

Ayush Gupta

Ayush Gupta

Updated on 01-Apr-2020 06:47:34

154 Views

In this tutorial, we will be discussing a program to understand iterator invalidation in C++.While iterating over the elements of a container object, sometimes it can become invalidated if we don’t apply bound checks. This mainly occurs due to the change in the shape and size of the container object.Example Live ... Read More

MakeFile in C++ and its applications

Ayush Gupta

Ayush Gupta

Updated on 01-Apr-2020 06:46:17

260 Views

In this tutorial, we will be discussing a program to understand MakeFile in C++ and its applications.The task is to break the entire program with MakeFile. It is usually done by making .cpp files and .h files with all the classes/functionalities and link them together.Examplemain.cpp#include #include "function.h" using namespace ... Read More

Kruskal’s Minimum Spanning Tree using STL in C++

Ayush Gupta

Ayush Gupta

Updated on 01-Apr-2020 06:43:15

486 Views

In this tutorial, we will be discussing a program to understand Kruskal’s minimum spanning tree using STL in C++.For this, we will be provided with a connected, undirected and weighted graph. Our task is to calculate the Minimum spanning tree for the given graph.Example Live Demo#include using namespace std; typedef pair ... Read More

Lower bound in C++

Ayush Gupta

Ayush Gupta

Updated on 01-Apr-2020 06:41:03

308 Views

In this tutorial, we will be discussing a program to understand the lower bound in C++.lower_bound() method in C++ is used to return the very first number in the container object which is not less than the given value.Example Live Demo#include int main(){    std::vector v{ 10, 20, 30, 40, ... Read More

Iseek() in C/C++ to read the alternate nth byte and write it in another file

Ayush Gupta

Ayush Gupta

Updated on 01-Apr-2020 06:38:41

724 Views

In this tutorial, we will be discussing a program to understand how to read the alternate nth byte and write it in another file.For this, we will be provided with two .txt files. Our task is to write the contents from one file to another file using Iseek() which is ... Read More

Internal details of std::sort() in C++

Ayush Gupta

Ayush Gupta

Updated on 01-Apr-2020 06:31:34

252 Views

In this tutorial, we will be discussing a program to understand the internal details of std::sort() in C++.std::sort() function is used to sort down an array using a comparison of the elements. If we look at the in-depth functionality of std::sort() it uses IntroSort algorithm to sort the elements of ... Read More

INT_MAX and INT_MIN in C/C++ and Applications

Ayush Gupta

Ayush Gupta

Updated on 01-Apr-2020 06:30:53

3K+ Views

In this tutorial, we will be discussing a program to understand INT_MAX and INT_MIN in C/C++.INT_MIN and INT_MAX are macros that are defined to set the minimum and maximum value for a variable/element.Example Live Demo#include int main(){    printf("%d", INT_MAX);    printf("%d", INT_MIN);    return 0; }Output2147483647 -2147483648ApplicationCalculating MIN value in ... Read More

Advertisements