Karthikeya Boyini has Published 2383 Articles

Count number of ways to reach a given score in a game

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 14:52:58

533 Views

Let us consider a game, in which a player can get some score with 3, 5 or 10 in each move. A target score is also given. Our task is to find how many possible ways are there to reach that target score with those three points.By the dynamic programming ... Read More

Egg Dropping Puzzle

karthikeya Boyini

karthikeya Boyini

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

494 Views

This is a famous puzzle problem. Suppose there is a building with n floors, if we have m eggs, then how can we find the minimum number of drops needed to find a floor from which it is safe to drop an egg without breaking it.There some important points to ... Read More

Strongly Connected Graphs

karthikeya Boyini

karthikeya Boyini

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

3K+ Views

In a directed graph is said to be strongly connected, when there is a path between each pair of vertices in one component.To solve this algorithm, firstly, DFS algorithm is used to get the finish time of each vertex, now find the finish time of the transposed graph, then the ... Read More

Layers of canvas fabric.js

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 13:51:07

849 Views

FabricJS has the following API methods that change the z-index of objects:canvas.sendBackwards(myObject) canvas.sendToBack(myObject) canvas.bringForward(myObject) canvas.bringToFront(myObject)You can also use:fabric.Canvas.prototype.orderObjects = function(compare) {    this._objects.sort(compare);    this.renderAll(); }

Check For Star Graph

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 13:50:23

496 Views

A graph is given; we have to check the given graph is a star graph or not.By traversing the graph, we have to find the number of vertices has degree one, and number of vertices, whose degree is n-1. (Here n is the number of vertices in the given graph). ... Read More

Graph Coloring

karthikeya Boyini

karthikeya Boyini

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

5K+ 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

7K+ 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

3K+ 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

2K+ 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

Advertisements