Karthikeya Boyini has Published 2193 Articles

Graph Coloring

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 12:53:49

7K+ Views

Graph coloring problem is a special case of graph labeling. In this problem, each node is colored into some colors. But coloring has some constraints. We cannot use the same color for any adjacent vertices.For solving this problem, we need to use the greedy algorithm, but it does not guaranty ... Read More

Maximum Bipartite Matching

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 12:37:58

9K+ Views

The bipartite matching is a set of edges in a graph is chosen in such a way, that no two edges in that set will share an endpoint. The maximum matching is matching the maximum number of edges.When the maximum match is found, we cannot add another edge. If one ... Read More

Check if a given graph is tree or not

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 11:46:28

4K+ Views

In this problem, one undirected graph is given, we have to check the graph is tree or not. We can simply find it by checking the criteria of a tree. A tree will not contain a cycle, so if there is any cycle in the graph, it is not a ... Read More

Depth First Search (DFS) for a Graph

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 11:31:14

3K+ Views

The Depth-First Search (DFS) is a graph traversal algorithm. In this algorithm, one starting vertex is given, and when an adjacent vertex is found, it moves to that adjacent vertex first and tries to traverse in the same manner.It moves through the whole depth, as much as it can go, ... Read More

Detect Cycle in a Directed Graph

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 11:25:14

3K+ Views

Using a Depth First Search (DFS) traversal algorithm we can detect cycles in a directed graph. If there is any self-loop in any node, it will be considered as a cycle, otherwise, when the child node has another edge to connect its parent, it will also a cycle.For the disconnected ... Read More

Euler Circuit in a Directed Graph

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 11:20:28

2K+ Views

The Euler path is a path, by which we can visit every edge exactly once. We can use the same vertices for multiple times. The Euler Circuit is a special type of Euler path. When the starting vertex of the Euler path is also connected with the ending vertex of ... Read More

What's the simplest way to print a Java array?

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 11:16:55

202 Views

Generally, to print the contents of an array you need to use for loops, in addition to that you can directly print an array using the toString() method of this class. This method accepts an array as a parameter and returns it in String format.ExampleLive Demoimport java.util.Arrays; public class ... Read More

Tug of War Algorithm

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 09:44:58

720 Views

In this problem a set of integers are given, we have to break them into two parts, such that the difference of the sum of two subsets is minimum as possible. So our target is to divide two groups of nearly equal strength to participate in the Tug of war ... Read More

Max Number By Swapping

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 09:39:27

473 Views

In this problem, one positive integer string is given, we have to find the permutation whose value is maximum by swapping digits’ k times, into different places.We will solve this problem by choosing a digit and swap it with digits following it one at a time to find a maximum ... Read More

Peak Element in 2D array

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 09:33:16

1K+ Views

An item is said to be a peak element when it is greater than or equal with all four neighbor of that element. The neighbor elements are the top, bottom, left and right elements. For this problem, we will consider some bounds. The diagonal elements are not checked as neighbor ... Read More

Advertisements