Skip to content

Tag Archives: binary-representation

Given a natural number N, the task is to find the largest number M having the same length in binary representation as N such that… Read More
Given a binary array arr[] of length N, and an integer K, the task is to find the maximum number of consecutive ones after flipping… Read More
Given an integer N, the task is to find the maximum frequency of set bits among all pairs of integers from 0 to N that… Read More
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… Read More
Given a number N, the task is to check first whether the given number is binary or not and its value should be greater than… Read More
Given an array of N elements which denotes the array representation of binary heap, the task is to find the leaf nodes of this binary… Read More
Given a positive integer N, the task is to check whether the binary equivalent of that integer ends with the given string str or not. Print… Read More
Given a grid of size N*M consists of 0 and 1 only, the task is to find the length of longest connected 1s in the… Read More
Given an integer N, the task is to find the total number of bits toggled to obtain all numbers from 0 to N sequentially. Examples:… Read More
Prerequisite: Bitset function in STL library Given a number N, the task is to find the absolute difference of the number of set and unset bits… Read More
Given an integer N, the task is to flip all the bits to the left of rightmost set bit and print the number generated. Examples:… Read More
Given a binary valued undirected graph with V vertices and E edges, the task is to find the hexadecimal equivalents of all the connected components… Read More
Given a binary array arr, the task is to find the maximum number of 0s that can be flipped such that the array has no… Read More
Given a number N, the task is to write C program to count the number of 0s and 1s in the binary representation of N.… Read More