Arjun Thakur has Published 1109 Articles

Jarvis March Algorithm

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 09:59:36

3K+ Views

Jarvis March algorithm is used to detect the corner points of a convex hull from a given set of data points.Starting from a leftmost point of the data set, we keep the points in the convex hull by anti-clockwise rotation. From a current point, we can choose the next point ... Read More

Print all permutations of a given string

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 09:55:28

1K+ Views

Printing all permutations of a given string is an example of backtracking problem. We will reduce the size of the substring to solve the sub-problems, then again backtrack to get another permutation from that section.For an example, if the string is ABC, the all permutations will be ABC, ACB, BAC, ... Read More

Connect n ropes with minimum cost

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 09:37:27

700 Views

There are N ropes of given lengths. We have to connect with them. The cost of connecting one rope with other is the sum of their lengths. Our goal is to connect the N ropes with minimum cost.This problem can be solved using a heap tree. We will create min ... Read More

Check if a given point lies inside a Polygon

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 09:18:13

3K+ Views

In this problem, one polygon is given, and a point P is also given. We need to check whether the point is inside the polygon or outside the polygon.For solving it we will draw a straight line from the point P. It extends to the infinity. The line is horizontal, ... Read More

Minimum number of coins that make a given value

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 07:44:20

2K+ Views

There is a list of coin C(c1, c2, ……Cn) is given and a value V is also given. Now the problem is to use the minimum number of coins to make the chance V.Note: Assume there is the infinite number of coins C.In this problem, we will consider a set ... Read More

Mobile Numeric Keypad Problem

Arjun Thakur

Arjun Thakur

Updated on 17-Jun-2020 07:31:04

1K+ Views

In this problem, a Numeric mobile keypad is given. We can only press top, bottom, right and left buttons of the current button, diagonal keys are not Allowed. We also cannot press the * and # buttons in the keypad.A digit is given, we have to find the number of ... Read More

Collect maximum points in a grid using two traversals

Arjun Thakur

Arjun Thakur

Updated on 16-Jun-2020 15:18:04

229 Views

There is a matrix with points in each cell, how to get maximum points from that grid using two traversals.There is some condition to satisfy −The first traversal starts from the top left cell in the grid and should go to the bottom left corner.      And in the ... Read More

Count possible ways to construct buildings

Arjun Thakur

Arjun Thakur

Updated on 16-Jun-2020 14:50:22

515 Views

Here n number of sections are given, in each section, there are two sides on the road to constructing buildings. If there is one empty space between two houses are needed, then how many possible ways to construct buildings in the plot.There are four possibilities to construct buildings One side of ... Read More

Find the minimum cost to reach destination using a train

Arjun Thakur

Arjun Thakur

Updated on 16-Jun-2020 14:24:16

499 Views

For this problem, there are N stops on a journey. The vehicle starts the journey from stop 0 to N-1. In a table, ticket costs for all pair of stations are given. We have to find the minimum cost to reach the destination with those given costs.Input and OutputInput: The ... Read More

How to find if a graph is Bipartite?

Arjun Thakur

Arjun Thakur

Updated on 16-Jun-2020 12:41:36

4K+ Views

A graph is said to be a bipartite graph, when vertices of that graph can be divided into two independent sets such that every edge in the graph is either start from the first set and ended in the second set, or starts from the second set, connected to the ... Read More

Advertisements