# Tag Archives: binary-representation

## Check if a number is binary or not in Java

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 »

## Print all the leaf nodes of Binary Heap

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 »

## Check whether the binary equivalent of a number ends with given string or not

Given a positive integer N, the task is to check whether the binary equivalent of that integer ends with a given string str or not. Print… Read More »

## Length of longest connected 1’s in a Binary Grid

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 »

## Count of total bits toggled/flipped in binary representation of 0 to N

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 »

## Absolute difference between set and unset bit count in N

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… Read More »

## Number formed by flipping all bits to the left of rightmost set bit

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 »

## Hexadecimal equivalents in Binary Valued Graph

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 »

## Maximum number of 0s that can be flipped such that Array has no adjacent 1s

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 »

## C program to count zeros and ones in binary representation of a number

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 »

## Check whether the binary equivalent of a number ends with “001” or not

Given a positive integer N, the task is to check whether the binary equivalent of that integer ends with “001” or not. Print “Yes” if… Read More »

## Check if a matrix contains a square submatrix with 0 as boundary element

Given an N*N binary matrix arr[][], the task is to check if the matrix contains a square of at least size 2 x 2 whose… Read More »

## Maximum decimal equivalent possible among all connected components of a Binary Valued Graph

Given a binary valued Undirected Graph with V vertices and E edges, the task is to find the maximum decimal equivalent among all the connected… Read More »

## Minimum flips required to generate continuous substrings of 0’s and 1’s

Given a binary string S of length N, the task is to find the minimum number of bit flips required to convert the given string… Read More »

## Octal equivalents of connected components in Binary valued graph

Given a binary valued undirected graph with V vertices and E edges, the task is to find the octal equivalents of all the connected components… Read More »