## Check if the given binary tree is Full or not.

Objective: Given a binary tree, write an algorithm to check if the tree is Full or not. Full binary tree: A binary tree T is full if each node is either a leaf or...

@tutorialhorizon

Objective: Given a binary tree, write an algorithm to check if the tree is Full or not. Full binary tree: A binary tree T is full if each node is either a leaf or...

Objective: Given a graph represented by the adjacency List, write a Depth-First Search(DFS) algorithm to check whether the graph is bipartite or not. Earlier we have solved the same problem using Adjacency Matrix (Check...

Objective: Given a number N, write an algorithm to find the maximum number of steps it takes to transform (1, N) to 1 using Collatz Conjecture. The Collatz conjecture is a conjecture in mathematics...

Objective: Given a stack, write a program to print the stack elements in reverse order. Example: Approach: Use Temporary stack: Take temporary stack, and copy all the items from the given stack to a...

Objective: Given a stack of integers, write an algorithm to sort the stack using recursion. Example: Original Stack: [14, 9, 67, 91, 101, 25] Sorted Stack: [9, 14, 25, 67, 91, 101] Original Stack:...

Objective: Given an array of numbers, write an algorithm to print all the subsets sum individually. Example: Given Input: [1, 2] Output: 3 1 2 0 Explanation: subsets are [0], [1], [2], [1, 2]...

Objective: Given the banks and range of routing numbers for each bank. You have given a routing number, write a program to determine which bank it belongs to. Input: Given a list of routing...

Objective: Given 1-D list of coordinates, (x1, x2), (x3, x4), , , ,(xn-1, xn)and interval (a, b). Write an algorithm to determine if interval (a,b) is covered in the list of coordinates. Example: Coordinates...

Objective: Given an array of integers (in particular order or permutation of a set of numbers), write an algorithm to find the lexicographically previous permutation of the given permutation with only one swap. This...

Objective: Given two integers N and K. Write an algorithm to find all the combinations of k numbers which sum to N. Conditions: All K numbers must be between 1 and 9 and unique....

Objective: Given a number N, write a program to find a complement number of the given number. Flip all the bits of a number to get the complement of that number. Example: N =...

Objective: Given an array of integers write an algorithm to find all the subsets for which sum is equal to zero. The array contains both positive and negative integers. Example: Given Array: [8, 3,...

Given- Given V vertices, what is the maximum number of edges can be added to make Acyclic Undirected Graph. Follow up – what is the maximum number of edges that can be added to...

Earlier we had discussed how to evaluate prefix expression where operands are of single-digit. In this article, we will discuss how to evaluate prefix expression for any number ( not necessarily single digit.) Prefix...

Objective: Given a two-dimensional array or matrix, Write an algorithm to print the given matrix in a zigzag manner or in other words print all the diagonals of the matrix. Example: int [][] grid...

%d bloggers like this: