Category: Recursion

3

Level Order Traversal in Zig Zag pattern OR Print in Spiral Pattern

Objective: Given a binary Tree, Do Level Order Traversal in Zig Zag pattern OR Print in Spiral Input: A Binary Tree Output: Order Traversal in Zig Zag pattern OR Print in Spiral.

3

Determine whether given binary tree is binary search tree(BST) or not

Objective: Given a Binary tree, find out whether its binary search tree or not. Input: A Binary Tree. Output: True or false based on whether tree is BST ot not. Approach: Method 1 :...

1

Given two binary trees, check if one binary tree is a subtree of another

Objective: Given two binary trees, check if one binary tree is a subtree of another Input: Two binary trees Output: True or false based on whether one tree is subtree of another Example :...

0

Print a path from Root to Node in Binary Tree

Objective: Given a Binary tree (Not binary Search Tree ), Print a path from root to a given node. Input: A binary tree, a node x Output: Path from root to a given node...

1

Inorder Successor in Binary Search Tree without Using Parent link

Objective: Given a Binary Search tree, find the inorder successor of a node. What is Inorder Successor: Inorder successor of a node is the next node in the inorder traversal of the tree. For...

2

Inorder Successor in Binary Search Tree Using Parent link

Algorithms – Inorder Successor in Binary Search Tree Using Parent link Objective: Given a Binary Search tree in which every node has a link to its parent, find the inorder successor of a node....

0

Inorder Successor in Binary Tree

Algorithms – Inorder Successor in Binary Tree Objective: Given a Binary tree (Not binary Search Tree ), find the inorder successor of a node. What is Inorder Successor: Inorder successor of a node is...

3

Sorted Array to Binary Search Tree of Minimal Height

Objective: Given a sorted array with unique elements, Create a binary search tree with minimal height. Why minimal height is important : We can do the linear scan to the array and make the...

%d bloggers like this: