Imagine a rooted tree ( with root as node 1). Every node is given two values, init value and expected value. Our task is to flip the node value to make the Read more →
Tree
7 postsGiven a Complete Binary Tree, the task is to print the elements in the Clockwise Triangular traversal order. Examples : Input : 1 / \ 2 3 / \ / \ 4 Read more →
Given N coins initially all tails up (let say represented by ‘0’) and a number of queries Q. There are two types of queries. Update: 1) Given indices of a range [L, Read more →
Amanada, a school kid, is learning English alphabets. Her teacher devised a small game to make the task fun. A grid of ‘m’ rows and ‘n’ columns is filled with English alphabets. Read more →
Given a binary tree and two nodes a and b, the task is to print the maximum node value that lies in the path connecting the nodes a and b. If either Read more →
Given a Rooted Tree with n node, labeled from 1 to n and tree is rooted at node 1. Parent of i-th node is p[i], i is starting from 2 as 1 Read more →
We all must have encountered the vertical Traversal of the Binary Tree problem. In this version of the problem we will see how we can perform the traversal vertically while keeping in Read more →