Tutorials
Courses
Data Structure
Java
Python
HTML
Interview Preparation
DSA
Practice Problems
C
C++
Java
Python
JavaScript
Data Science
Machine Learning
Courses
Linux
DevOps
SQL
Web Development
System Design
Aptitude
GfG Premium
Similar Topics
Web Technologies
37.4K+ articles
DSA
22.8K+ articles
Misc
8.8K+ articles
Mathematical
7.8K+ articles
Arrays
6.5K+ articles
C++
4.3K+ articles
C++ Programs
2.4K+ articles
STL
1.3K+ articles
Bit Magic
1.2K+ articles
CPP-Functions
619+ articles
CPP-bitset
30 posts
Recent Articles
Popular Articles
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
_Find_first() function in C++ bitset with Examples
Last Updated: 22 December 2022
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
_Find_next() function in C++ bitset with Examples
Last Updated: 22 December 2022
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
Check if binary representations of 0 to N are present as substrings in given binary string
Last Updated: 18 June 2022
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
Queries to minimize sum added to given ranges in an array to make their Bitwise AND non-zero
Last Updated: 10 January 2023
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
Bit Magic
Mathematical
Competitive Programming
DSA
Arrays
array-range-queries
prefix-sum
CPP-bitset
Bitwise-AND
Find the Dominators for every vertex in a given DAG (Directed Acyclic Graph)
Last Updated: 06 June 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
Construct a K-length binary string from an array based on given conditions
Last Updated: 04 January 2023
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
Arithmetic operations with std::bitset in C++
Last Updated: 17 June 2021
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
Bit Magic
C++
DSA
CPP-bitset
Implementation of C++ Bitset using String
Last Updated: 28 March 2022
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
Introduction to Bitwise Algorithms - Data Structures and Algorithms Tutorial
Last Updated: 27 November 2024
Bit stands for binary digit. A bit is the basic unit of information and can only have one of two possible values that is 0 or 1. In our world, we usually with numbers usin...
read more
Bit Magic
Algorithms
DSA
setBitCount
Bitwise-XOR
CPP-bitset
Bit Algorithms
Bitwise-OR
Bitwise-AND
Tutorials
DSA-Blogs
DSA Tutorials
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
How to Create Stack of Bitset in C++?
Last Updated: 06 March 2024
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
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 Count Set Bits in an Integer in C++?
Last Updated: 03 July 2024
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
How to Use Bit Manipulation Methods in C++
Last Updated: 17 July 2024
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++ Programs
Picked
CPP-bitset
C++ Bit Manipulation
CPP Examples
1
2
We use cookies to ensure you have the best browsing experience on our website. By using our site, you acknowledge that you have read and understood our
Cookie Policy
&
Privacy Policy
Got It !