Consider a tree with n nodes and root. You can jump from one node to any other node on the same height a maximum of k times on total jumps. Certain nodes of the tree ...

Share

Given a very long list of URLs, find out last unique URL. Only one traversal of all URLs is allowed.
Examples:
Input:
https://www.geeksforgeeks.org
http://quiz.geeksf...

Share

Given a generic tree, perform a Level order traversal and print all of its nodes
Input : 10
/ /
2 34 56 100
...

Share

Given an array of n numbers. The problem is to move all the 0’s to the end of the array while maintaining the order of the other elements. Only single traversa...

Share

Given preorder traversal of a binary search tree, construct the BST.
For example, if the given traversal is {10, 5, 1, 7, 40, 50}, then the output should be root of f...

Share

Given preorder traversal of a binary search tree, construct the BST.
For example, if the given traversal is {10, 5, 1, 7, 40, 50}, then the output should be root of f...

Share

Construct the BST (Binary Search Tree) from its given level order traversal.
Examples:
Input : arr[] = {7, 4, 12, 3, 6, 8, 1, 5, 10}
Output : BST:
7
...

Share

Given an array of size n. The problem is to check whether the given array can represent the level order traversal of a Binary Search Tree or not.
Examples:
Input : ar...

Share

We have discussed Thread based Morris Traversal. Can we do inorder traversal without threads if we have parent pointers available to us?
Input: Root of Below Tree [E...

Share

Unlike linear data structures (Array, Linked List, Queues, Stacks, etc) which have only one logical way to traverse them, trees can be traversed in different ways. Fo...

Share