Skip to content

Tag Archives: complement

Given two sorted arrays arr1 and arr2 of size m and n respectively. We need to find relative complement of two array i.e, arr1 –… Read More
Given an integer n, find the one’s complement of the integer. Examples:   Input : n = 5 Output : 2 Input : n = 255 Output… Read More
9’s complement of a decimal number is the subtraction of it’s each digits from 9. Like 1’s complement, 9’s complement is used to subtract a… Read More
Given two non-negative integers a and b. The problem is to check if one of the two numbers is 1’s complement of the other. The ones’… Read More
Given a positive number you need to check whether it’s complement and the number are anagrams or not.Examples:   Input : a = 4294967295 Output :… Read More
Given a Binary Number as string, print its 2’s complements.2’s complement of a binary number is 1 added to the 1’s complement of the binary… Read More
Given a Binary Number as a string, print its 1’s and 2’s complements.  1’s complement of a binary number is another binary number obtained by… Read More
Prerequisite – Representation of Negative Binary Numbers 1’s complement of a binary number is another binary number obtained by toggling all bits in it, i.e.,… Read More