Welcome To Tutorialspoint.dev
Officially launched 18th May 2019

# Lowest Common Ancestor in a Binary Tree Set 1

Given a binary tree (not a binary search tree) and two values say n1 and n2, write a program to find the least common ancestor. Following is definition of LCA from W...

# Rat in a Maze Backtracking-2

We have discussed Backtracking and Knight&#x2019;s tour problem in Set 1. Let us discuss Rat in a Maze as another example problem that can be solved using Backtracki...

# Maximum length subsequence with difference between adjacent elements as either 0 or 1

Given an array of n integers. The problem is to find maximum length of the subsequence with difference between adjacent elements as either 0 or 1. Examples: Input : a...

# Find if two rectangles overlap

Given two rectangles, find if the given two rectangles overlap or not. Note that a rectangle can be represented by two coordinates, top left and bottom right. So mai...

# Foldable Binary Trees

Question: Given a binary tree, find out if the tree can be folded or not. A tree can be folded if left and right subtrees of the tree are structure wise mirror image ...

# Lowest Common Ancestor in a Binary Tree Set 1

Given a binary tree (not a binary search tree) and two values say n1 and n2, write a program to find the least common ancestor. Following is definition of LCA from W...

# Rat in a Maze Backtracking-2

We have discussed Backtracking and Knight&#x2019;s tour problem in Set 1. Let us discuss Rat in a Maze as another example problem that can be solved using Backtracki...