Author: prodevelopertutorial
Follow this blog to learn more about C, C++, Linux, Competitive Programming concepts, Data Structures.
In this tutorial we shall see how to do vertical order traversal. Problem Statement: You are given a root node of a tree, you need to print the nodes when they are traversed vertically. Consider the tree given below: The vertical order traversal …
In this tutorial we shall see how to print level by level of the tree nodes. Problem Statement: Given the root node of the tree, print the nodes level by level. For example: Consider the tree below: Here the level order traversal …
Problem Statement: Given a binary tree, print the left and right view of the tree. For example: If you have a tree as below: The left view will be a, b, d, h and right view will be a, c, g, j. As …
We shall solve boundary traversal of binary tree in this tutorial. Problem Statement: Given a binary tree, list all the nodes that come in the boundary. Consider the tree as below: So the boundary traversal will be as below: a b d …
In this tutorial, we shall solve how to print bottom view of a binary tree. Problem statement: You are given a binary tree; you need to print the bottom view of a binary tree. Consider the tree: So the solution would be h …
In this tutorial we shall solve building bridges problem with help of DP. This is a classical DP problem. Problem statement: Given a river, you need to build a bridge across the river in such a way that only he pair given can form a bridge, …
This is a classical DP problem. In this tutorial we shall see how to solve box stacking problem. We shall solve it by DP approach. Problem Statement: You are given n number of boxes, and you need to place the boxes on top of each other …