Skip to content

Tag Archives: Traversal

Given two BSTs containing n1 and n2 distinct nodes respectively. Given a value x. The problem is to count all pairs from both the BSTs… Read More
Given a Binary Tree, find sum of all right leaves in it. Similar article : Find sum of all left leaves in a given Binary TreeExample… Read More
Prerequisite – Array Basics Given an array, write a program to find the sum of values of even and odd index positions separately. Examples: Input… Read More
Given a Binary Search Tree, find median of it. If no. of nodes are even: then median = ((n/2th node + (n+1)/2th node) /2 If… Read More
Given a Binary Tree, find the sum of all left leaves in it. For example, sum of all left leaves in below Binary Tree is… Read More
We have discussed Circular Linked List Introduction and Applications, in the previous post on Circular Linked List. In this post, traversal operation is discussed.    … Read More
Given a Binary tree and a key in the binary tree, find the node right to the given key. If there is no node on… Read More
Given an array ‘pre[]’ that represents Preorder traversal of a spacial binary tree where every node has either 0 or 2 children. One more array… Read More