GeeksforGeeks

A computer science portal for geeks

GeeksQuiz

Login

Given the binary Tree and the two nodes say ‘a’ and ‘b’, determine whether the two nodes are cousins of each other or not.

Read More »

Given two binary trees, check if the first tree is subtree of the second one. A subtree of a tree T is a tree S consisting of a node in T and all of its descendants in T.

Read More »

I recently encountered with a question in an interview at e-commerce company. The interviewer asked the following question:

Read More »

Given a binary tree in which each node element contains a number. Find the maximum possible sum from one leaf node to another.

Read More »

Given a Perfect Binary Tree, reverse the alternate level nodes of the binary tree.

Read More »

Given a BST, transform it into greater sum tree where each node contains sum of all nodes greater than that node.

Read More »

Given a binary tree, print it vertically. The following example illustrates vertical order traversal.

Read More »

Given a Binary Tree, print Right view of it. Right view of a Binary Tree is set of nodes visible when tree is visited from Right side.

Read More »

We have discussed following topics on Red-Black tree in previous posts. We strongly recommend to refer following post as prerequisite of this post.

Read More »

Given inorder and level-order traversals of a Binary Tree, construct the Binary Tree. Following is an example to illustrate the problem.

Read More »

Given a binary tree, a target node in the binary tree, and an integer value k, print all the nodes that are at distance k from the given target node. No parent pointers are available.

Read More »

Given a binary tree, print it vertically. The following example illustrates vertical order traversal.

Read More »

Consider a situation where we have a set of intervals and we need following operations to be implemented efficiently.

Read More »

In a Red-Black Tree, the maximum height of a node is at most twice the minimum height

Read More »
Page 1 of 912345...Last »