## Inorder predecessor and successor for a given key in BST | Iterative Approach

Given a BST and a key. The task is to find the inorder successor and predecessor of the given key. In case, if either of… Read More »

- Reverse zigzag Traversal of a Binary Tree
- Create new linked list from two given linked list with greater element at each node
- Print Binary Tree levels in sorted order | Set 3 (Tree given as array)
- Find sum of even and odd nodes in a linked list
- Count duplicates in a given linked list
- Delete Nth node from the end of the given linked list
- Sum of nodes in a linked list which are greater than next node
- Sum of all distinct nodes in a linked list
- Find the node with minimum value in a Binary Search Tree using recursion
- Element in a matrix starting from which anti-clockwise traversal ends at the last element
- Sum of smaller elements of nodes in a linked list
- Check whether the sum of element of a node is equal to the given key value
- Create a linked list from two linked lists by choosing max element at each position
- Find the balanced node in a Linked List
- Print all the sub diagonal elements of the given square matrix
- Print all the super diagonal elements of the given square matrix
- Compare sum of first N-1 elements to Nth element of an array

Given a BST and a key. The task is to find the inorder successor and predecessor of the given key. In case, if either of… Read More »

Given an array A of N numbers where Ai represent the value of the (i+1)th node. Also given are M pair of edges where u… Read More »

Given a Binary tree and a number N, write a program to find the N-th node in the Postorder traversal of the given Binary tree.… Read More »

Given a binary tree, find the vertical width of the binary tree. The width of a binary tree is the number of vertical paths. In… Read More »

Write a function to print ZigZag order traversal of a binary tree. For the below binary tree the zigzag order traversal will be 1 3… Read More »

Given two arrays that represent Preorder traversals of a full binary tree and its mirror tree, we need to write a program to construct the… Read More »

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

Given a binary tree containing n nodes. The problem is to find the sum of all nodes on the longest path from root to leaf… Read More »

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… 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 sum of all left leaves in it. For example, sum of all left leaves in below Binary Tree is 5+1=6.… 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. Recommended:… 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 »