## HashSet vs TreeSet in Java

Speed and internal implementation HashSet : For operations like search, insert and delete. It takes constant time for these operations on average. HashSet is faster… Read More »

Quick Links for Tree

Quizzes |

Speed and internal implementation HashSet : For operations like search, insert and delete. It takes constant time for these operations on average. HashSet is faster… Read More »

Given Inorder and Postorder traversals of a binary tree, print Preorder traversal. Example: Input: Postorder traversal post[] = {4, 5, 2, 6, 3, 1} Inorder… Read More »

Given a binary tree containing n distinct numbers and a value x. The problem is to count pairs in the given binary tree whose sum… Read More »

Given a Binary Tree and a Level. The task is to find the node with the maximum value at that given level. Recommended: Please try… Read More »

Top view of a binary tree is the set of nodes visible when the tree is viewed from the top. Given a binary tree, print… Read More »

Given a tree of N nodes and N-1 edges. Also given an integer M and a node, the task is to print the M-th node… Read More »

Given a binary tree represented as parent array, find Lowest Common Ancestor between two nodes ‘m’ and ‘n’. In the above diagram, LCA of 10… Read More »

Given a K-ary Tree. The task is to write an iterative program to perform the preorder traversal of the given n-ary tree. Examples: Input: 3-Array… Read More »

Amadeus Software Labs India LTD, Bangalore recently visited Thapar Institute of Engineering & Technology (TIET) with two different profiles of Software developer and Quality Assurance.… Read More »

Given a tree of N nodes and N-1 edges. The task is to print the DFS of the subtree of a given node for multiple… Read More »

Given two binary trees. The task is to write a program to check if the two trees are identical in structure. In the above figure… Read More »

Given a Binary Tree, find the maximum sum in a binary tree by adding the parent with its children. Exactly three Node needs to be… Read More »

Given a BT and a key Node, find the total sum in BT, except those Node which are adjacent to key Node. Examples: Recommended: Please… Read More »

Given a binary tree, flatten it into a linked list. After flattening, the left of each node should point to NULL and right should contain… Read More »

Consider you have an infinitely long binary tree having a pattern as below: 1 / \ 2 3 / \ / \ 4 5 6… Read More »