## Vertex Cover Problem | Set 2 (Dynamic Programming Solution for Tree)

Leave a comment | Filed under TreesA vertex cover of an undirected graph is a subset of its vertices such that for every edge (u, v) of the graph, either ‘u’ or ‘v’ is in vertex cover.

Read More »## Check whether a binary tree is a complete tree or not | Set 2 (Recursive Solution)

Leave a comment | Filed under TreesA complete binary tree is a binary tree whose all levels except the last level are completely filled and all the leaves in the last level are all to the left side.

Read More »A full binary tree is defined as a binary tree in which all nodes have either zero or two child nodes. Conversely, there is no node in a full binary tree, which has one child node.

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+23+50 = 78.

Read More »Given a Binary Tree and a number k, remove all nodes that lie only on root to leaf path(s) of length smaller than k.

Read More »Given a Binary Tree and a key ‘k’, find distance of the closest leaf from ‘k’.

Read More »Consider lines of slope -1 passing between nodes (dotted lines in below diagram). Diagonal sum in a binary tree is sum of all node’s data lying between these lines.

Read More »Given a Binary Tree, we need to print the bottom view from left to right.

Read More »Let us consider the following problem to understand Binary Indexed Tree.

Read More »Reverse DNS look up is using an internet IP address to find a domain name. For example, if you type 74.125.200.106 in browser, it automatically redirects to google.in.

Read More »Given n appointments, find all conflicting appointments.

Read More »Given a Perfect Binary Tree like below: (click on image to get a clear view)

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 the top view of it. The output nodes can be printed in any order.

Read More »A K-D Tree(also called as K-Dimensional Tree) is a binary search tree where data in each node is a K-Dimensional point in space.

Read More »