## Number of Hamiltonian cycle

Given an undirected complete graph of N vertices where N > 2. The task is to find the number of different Hamiltonian cycle of the… Read More »

## Iterative Letter Combinations of a Phone Number

Given an integer array containing digits from [0, 9], the task is to print all possible letter combinations that the numbers could represent. A mapping… Read More »

## Zig-Zag traversal of a Binary Tree using Recursion

Given a Binary Tree, the task is to print the zigzag order of the tree. Examples: Input : 7 / \ 6 5 / /… Read More »

## Generate a random permutation of elements from range [L, R] (Divide and Conquer)

Given a range [L, R] where L ≤ R, the task is to generate a random permutation of the sequence [L, L + 1, L… Read More »

## Determine the count of Leaf nodes in an N-ary tree

Given the value of ‘N’ and ‘I’. Here, represents the number of internal nodes present in an N-ary tree and every node of the N-ary… Read More »

## Sum of minimum elements of all possible sub-arrays of an array

Given an array arr[], the task is to find the sum of the minimum elements of every possible sub-array of the array. Examples: Input: arr[]… Read More »

## Sum of maximum elements of all possible sub-arrays of an array

Given an array arr[], the task is to find the sum of the maximum elements of every possible sub-array of the array. Examples: Input: arr[]… Read More »

## Count the number of rhombi possible inside a rectangle of given size

Given a rectangle of height H and width W which has the bottom left corner at (0, 0). The task is to count the number… Read More »

## Passing and Returning Objects in C++

In C++ we can pass class’s objects as arguments and also return them from a function the same way we pass and return other variables.… Read More »

## Choose points from two ranges such that no point lies in both the ranges

Given two segments [L1, R1] and [L2, R2], the task is to choose two elements x and y from both the ranges (one from range… Read More »

## Shortest path on a Square

Given side of a square n and two points (x1, y1) and (x2, y2) on the boundaries of the given square. The task is to… Read More »

## Find the product of first k nodes of the given Linked List

Given a pointer to the head of a singly linked list and an integer k. The task is to find the product of first k… Read More »

## Validation of Equation Given as String

Given a string in the form of an equation i.e A + B + C – D = E where A, B, C, D and… Read More »

## Filling diagonal to make the sum of every row, column and diagonal equal of 3×3 matrix

Given 9 elements in a 3 x 3 matrix where the value of diagonals are 0. We need to find the values in diagonal to… Read More »

## Sum of nodes at maximum depth of a Binary Tree | Set 2

Given a root node to a tree, find the sum of all the leaf nodes which are at maximum depth from root node. Example: 1… Read More »