Karthikeya Boyini has Published 2193 Articles

Partition problem

karthikeya Boyini

karthikeya Boyini

Updated on 17-Jun-2020 07:25:03

2K+ Views

For this problem, a given set can be partitioned in such a way, that sum of each subset is equal.At first, we have to find the sum of the given set. If it is even, then there is a chance to divide it into two sets. Otherwise, it cannot be ... Read More

Maximum Length Chain of Pairs

karthikeya Boyini

karthikeya Boyini

Updated on 17-Jun-2020 07:17:54

616 Views

There is a chain of pairs is given. In each pair, there are two integers and the first integer is always smaller, and the second one is greater, the same rule can also be applied for the chain construction. A pair (x, y) can be added after a pair (p, ... Read More

Maximum sum rectangle in a 2D matrix

karthikeya Boyini

karthikeya Boyini

Updated on 17-Jun-2020 07:02:10

2K+ Views

A matrix is given. We need to find a rectangle (sometimes square) matrix, whose sum is maximum.The idea behind this algorithm is to fix the left and right columns and try to find the sum of the element from the left column to right column for each row, and store ... Read More

Largest Sum Contiguous Subarray

karthikeya Boyini

karthikeya Boyini

Updated on 16-Jun-2020 15:40:34

811 Views

An array of integers is given. We have to find the sum of all elements which are contiguous, whose sum is largest, that will be sent as output.Using dynamic programming we will store the maximum sum up to current term. It will help to find the sum for contiguous elements ... Read More

Longest consecutive path from a given starting character

karthikeya Boyini

karthikeya Boyini

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

426 Views

A matrix of different characters is given. Starting from one character we have to find the longest path by traversing all characters which are greater than the current character. The characters are consecutive to each other.To find the longest path, we will use the Depth First Search algorithm. During DFS, ... Read More

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

karthikeya Boyini

karthikeya Boyini

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

715 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

662 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

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

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

664 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

Advertisements