## Move weighting scale alternate under given constraints

Given a weighting scale and an array of different positive weights where we have an infinite supply of each weight. Our task is to put… Read More »

Given a weighting scale and an array of different positive weights where we have an infinite supply of each weight. Our task is to put… Read More »

Depth-first search (DFS) is an algorithm for traversing or searching tree or graph data structures. One starts at the root (selecting some arbitrary node as… Read More »

Given a positive integer N. Consider a matrix of N X N. No cell can be accessible from any other cell, except the given pair… Read More »

Given an undirected connected tree with N nodes (and N-1 edges), we need to find two paths in this tree such that they are non-intersecting… Read More »

Given an undirected tree which has even number of vertices, we need to remove the maximum number of edges from this tree such that each… Read More »

Given a grid which consists of 4 types of characters : ‘B’ ‘.’ ‘S’ and ‘D’. We need to reach D starting from S, at… Read More »

Given an undirected tree whose each node is associated with a weight. We need to delete an edge in such a way that difference between… Read More »

Consider a matrix with rows and columns, where each cell contains either a ‘0’ or a ‘1’ and any cell containing a 1 is called… Read More »

Problem Statement : Given a graph which represents a flow network where every edge has a capacity. Also given two vertices source ‘s’ and sink… Read More »

Given a tree of n even nodes. The task is to find the maximum number of edges to be removed from the given tree to… Read More »

Given an array of strings, find if the given strings can be chained to form a circle.

We are given a map of cities connected with each other via cable lines such that there is no cycle between any two cities. We… Read More »

Given two integers ‘n’ and ‘m’, find all the stepping numbers in range [n, m]. A number is called stepping number if all adjacent digits… Read More »

We have discussed flattening of a multi-level linked list where nodes have two pointers down and next. In the previous post, we flattened the linked… Read More »

There are two common ways to traverse a graph, BFS and DFS. Considering a Tree (or Graph) of huge height and width, both BFS and… Read More »