Courses
Tutorials
Interview Prep
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
Similar Topics
Web Technologies
32.1K+ articles
DSA
20.4K+ articles
Misc
7.7K+ articles
Mathematical
5.1K+ articles
Arrays
4.2K+ articles
C++
3.8K+ articles
Strings
2.1K+ articles
STL
1.3K+ articles
Bit Magic
821+ articles
CPP-Functions
619+ articles
CPP-bitset
30 posts
Recent Articles
How to Use Bit Manipulation Methods in C++
Last Updated: 23 July 2025
Bit manipulation is a technique used for optimizing performance and memory usage in various programming scenarios. It is very useful from aCompetitive Programmingpoint of ...
read more
C++
Picked
CPP-bitset
C++ Bit Manipulation
CPP Examples
How to Count Set Bits in an Integer in C++?
Last Updated: 23 July 2025
In binary representation of a number, a set bit is defined as the binary digit (bit) that is set to 1. In this article, we will learn how to count the set bits in a given ...
read more
C++ Programs
C++
Picked
CPP-bitset
C++ Bit Manipulation
std::has_single_bit in C++ 20
Last Updated: 21 May 2024
In C++ 20, thestd::has_single_bitfunction is a predefined function that is used to check if a given value is an integral power of two or not.This function is defined in th...
read more
C++
Picked
CPP-Functions
CPP-bitset
C++ Bit Manipulation
How to Create Stack of Bitset in C++?
Last Updated: 23 July 2025
In C++, a stack is a container adapter that provides a last-in, first-out (LIFO) type of data structure with two major operations, namely push and pop while Bitset is a co...
read more
C++ Programs
C++
Picked
STL
CPP-bitset
cpp-stack
CPP Examples
Count of Non-Negative Integers that doesn't contain consecutive ones
Last Updated: 15 March 2023
Given a range of integers, the task is to find the numbers of Non-Negative Integers which doesn't contain consecutive ones (1s) in their binary representation.Examples:Inp...
read more
DSA
CPP-bitset
Introduction to Bitwise Algorithms
Last Updated: 09 May 2026
Bitwise operators are special operators in programming that work directly on binary bits (0 and 1). Since computers store all data in binary form, bitwise operations help ...
read more
DSA
setBitCount
Bitwise-XOR
CPP-bitset
Bit Algorithms
Bitwise-OR
Bitwise-AND
Tutorials
DSA-Blogs
DSA Tutorials
Implementation of C++ Bitset using String
Last Updated: 23 July 2025
Let's implement bitset in C++, such that following operations can be performed in stated time complexities :init(int size): initializes a bitset of size number of 0 bits.v...
read more
C++
Geeks Premier League
Geeks-Premier-League-2022
cpp-string
CPP-bitset
Arithmetic operations with std::bitset in C++
Last Updated: 23 July 2025
A bitset is an array of boolean values, but each boolean value is not stored separately. Instead, bitset optimizes the space such that each bool takes 1-bit space only, so...
read more
C++
CPP-bitset
Construct a K-length binary string from an array based on given conditions
Last Updated: 23 July 2025
Given an array arr[] consisting of N integers, and an integer K, the task is to construct a binary string of length K satisfying the following conditions:The character at ...
read more
Misc
Strings
Bit Magic
Greedy
Mathematical
DSA
Arrays
binary-string
CPP-bitset
Find the Dominators for every vertex in a given DAG (Directed Acyclic Graph)
Last Updated: 23 July 2025
Given a Directed Acyclic Graph with V vertices and E edges, the task is to find the set of dominant vertices for each vertex of the graph.What are Dominators in Graph Theo...
read more
Graph
DSA
DFS
CPP-bitset
Algorithms-Recursion
Queries to minimize sum added to given ranges in an array to make their Bitwise AND non-zero
Last Updated: 23 July 2025
Given an array arr[] consisting of N integers an array Q[][] consisting of queries of the form {l, r}. For each query {l, r}, the task is to determine the minimum sum of a...
read more
DSA
array-range-queries
prefix-sum
CPP-bitset
Bitwise-AND
Check if binary representations of 0 to N are present as substrings in given binary string
Last Updated: 15 July 2025
Give binary string str and an integer N, the task is to check if the substrings of the string contain all binary representations of non-negative integers less than or equa...
read more
Strings
Bit Magic
Hash
DSA
binary-string
binary-representation
CPP-bitset
Java-HashMap
Java-BitSet
substring
_Find_next() function in C++ bitset with Examples
Last Updated: 12 July 2025
The _Find_next() is a built-in function in C++ Bitset class which returns an integer which refers the position of next set bit in bitset after index. If there isn't any se...
read more
C++
CPP-Functions
CPP-bitset
_Find_first() function in C++ bitset with Examples
Last Updated: 12 July 2025
The _Find_first() is a built-in function in C++ Bitset class which returns an integer that refers the position of first set bit in bitset. If there isn’t any set bit, _Fin...
read more
C++
CPP-Functions
CPP-bitset
Count number of set bits in a range using bitset
Last Updated: 20 September 2023
Given a large binary number.The task is to count the number of 1's in a given range from L to R (1 based indexing).Examples:Input : s = "101101011010100000111", L = 6, R =...
read more
Bit Magic
Mathematical
DSA
CPP-bitset
1
2