Skip to content

Category Archives: C++

Periodic Binary String : A Binary string is called periodic if it can be written as repetition of a binary string of smaller or same… Read More
Vectors are same as dynamic arrays with the ability to resize itself automatically when an element is inserted or deleted, with their storage being handled… Read More
Semicolon is a punctuation mark (;) indicating a pause, typically between two main clauses, that is more pronounced than that indicated by a comma. In… Read More
The std::greater is a functional object which is used for performing comparisons. It is defined as a Function object class for the greater-than inequality comparison.… Read More
Given a string str, the task is to find the frequency of each character of a string using an unordered_map in C++ STL. Examples:  Input:… Read More
In this article, we will discuss some of the mathematical function which is used to derived the value of Pi(π) in C++. Method 1: Using… Read More
Prerequisite: Map in STL A map is a container which is used to store a key-value pair. By default, In Primitive datatypes such as int,… Read More
Array of Objects: When a class is defined, only the specification for the object is defined; no memory or storage is allocated. To use the… Read More
C++ allows users to use the concept of Run-Time Polymorphism using Virtual Functions for any type of Inheritance . Below is how to implement Run-Time… Read More
Given an integer N, the task is to find the Nth natural number with exactly two bits set. Examples: Input: N = 4 Output: 9… Read More
C++ is one of the most recommended languages in competitive programming (please refer our previous article for the reason) C++ STL contains lots of containers… Read More
Prerequisites: Ordered Set and GNU C++ PBDS Given an ordered set set and a key K, the task is to find the upper bound and lower… Read More
Given a Vector of Vectors (2D vector), the task is to flatten this 2d vector. Examples: Input: vector = [[1, 2, 3, 4], [5, 6],… Read More
Given string str of size N, the task is to remove all the characters from the string that have odd frequencies. Examples:  Input: str =… Read More
Before moving forward with using const with Reference to a Pointers, let us first see what they are one by one: Pointers are used to… Read More