## Find a Missing Number From a Sequence of Consecutive Numbers | XOR Method

Input: Array, arrA[] with a missing number and Range Output : missing number Example: int A[] = { 1, 2, 7, 6, 3, 4 }; int range = 7; Output: MIssing No is :5 In...

@tutorialhorizon

Input: Array, arrA[] with a missing number and Range Output : missing number Example: int A[] = { 1, 2, 7, 6, 3, 4 }; int range = 7; Output: MIssing No is :5 In...

Objective: – Given a binary tree , Find the max element in it. Example: Approach: Use Recursion. Max will the Max(root, max element in left subtree, max element in rightsubtree) Recursively solve for max...

Objective: – Given two binary trees check if they are mirror image of each other. Example: Approach:

Objective: Given a binary tree, print all nodes will are full nodes. Full Nodes: Nodes Which has both the children, left and right are called Full Nodes Approach: quite simple Solution. Do the any...

Objective: Given a sorted array of distinct integers, Find the Magic index or Fixed point in the array. Magic Index or Fixed Point: Magic index or a Fixed point in an array is an...

Objective: Given a range of integers, find all the numbers which are palindrome when they are represented in Decimal Value( base 10) and in Octal value(base 8). Example : Number : 373 (Decimal) and...

Objective: Given an array of integers such that first level will print all the elements in the array and from then at each level number of elements will be one less than the previous...

Goldbach’s conjecture – Every even integer greater than 2 can be represented as the sum of two primes numbers. Example: Given Number : 200 Prime Numbers are 3 197 Prime Numbers are 7 193...

Objective: Given a decimal number, convert it into irreducible fraction. Irreducible Fraction : An irreducible fraction is a fraction in which the numerator and denominator are integers that have no other common divisors than...

Objective: Find the Angle between hour hand and minute hand at the given time. Example: Time : 12:45 Input : hour = 12, Minute = 45 Output : 112.5 Time : 3:30 Input :...

What is Graph: G = (V,E) Graph is a collection of nodes or vertices (V) and edges(E) between them. We can traverse these nodes using the edges. These edges might be weighted or non-weighted....

The Tower of Hanoi is a mathematical game or puzzle. It consists of three rods, and a number of disks of different sizes which can slide onto any rod. The objective of the puzzle...

Objective: – Given an Integer array. Array contains duplicates of all the numbers in array except one number . Find that number. Example : int [] A = { 2,1,3,5,5,3,2,1,6,7,7,8,8}; Output : Missing duplicate...

Objective: – Given three integers, sort them without using if condition. Appraoch: Say 3 integers are, a, b, c. Find the maximum of a, b, c using Max() function. multiply all integers by -1....

The greatest common divisor (GCD) of two or more integers, when at least one of them is not zero, is the largest positive integer that divides the numbers without a remainder. For example, the...

%d bloggers like this: