Skip to content

Category Archives: C++ Programs

The is_sorted() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/is_sorted.hpp’ which tests if the given sequence is sorted or not according to… Read More
Given a sorted array, the task is to remove the duplicate elements from the array using STL in C++ Examples: Input: arr[] = {2, 2,… Read More
The is_partitioned() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/is_partitioned.hpp’ which tests if the given sequence is partitioned according to the given… Read More
The one_of_equal() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/one_of.hpp’ which tests if exactly one of the elements of a sequence against… Read More
The none_of() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/none_of.hpp’ which tests all the elements of a sequence and returns true if… Read More
The one_of() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/one_of.hpp’ which tests the elements of a sequence and returns true if exactly… Read More
The all_of() function in C++ boost library is found under the header ‘boost/algorithm/cxx11/all_of.hpp’ which tests all the elements of a sequence and returns true if… Read More
We can use Exception handling with class too. Even we can throw an exception of user defined class types. For throwing an exception of say… Read More
Given that person A takes a days to do a certain piece of work while person B takes b days to do the same work.… Read More
Given a string S, remove all the consecutive duplicates in this string using STL in C++ Examples: Input: Geeks for geeks Output: Geks for geks… Read More
A certain number of men can do a certain piece of work in D days. If there were m more men engaged in the work… Read More
Given an array arr[] of non-negative integers. We have to delete elements from this array such that arr[i + 1] > arr[j] for each valid… Read More
Given an array arr[] and a number K. The task is to find out the number of valid positions i such that (arr[i] + K)… Read More
Given an array of N elements. The task is to find the length of the longest subarray such that sum of the subarray is even.Examples:  … Read More
Given the first two terms of the series as 1 and 6 and all the elements of the series are 2 less than the mean… Read More

Start Your Coding Journey Now!