top of page
Caută

Knapsack Problem in JAVA

You must introduce values into a knapsack. With n items given with weights and values, return the maximum sum of values of the subset...

Count the ways to reach the n’th stair in JAVA

You receive as an input a number representing sections. Each section is composed of two plots, on either side of the road. You must find...

Count the possible ways to construct buildings in JAVA

You receive as an input a number representing sections. Each section is composed of two plots, on either side of the road. You must find...

Compute the sum of digits in all numbers from 1 to n in JAVA

You are given a limit and have to find the sum of all numbers from one to that limit. Solution: 1. static int sumOfDigitsFrom1ToN(int...

Collect maximum points in a grid using two traversals in JAVA

Using a grid of cells that holds values, try to find the maximum number of points that can be summed by using two traversals. The first...

Coin Change in JAVA

You are given an integer array of coin values and an integer representing the total amount of money. Return the number of possible ways...

Boolean Parenthesization Problem in JAVA

Given a Boolean expression with the following symbols: 'T' ---> true 'F' ---> false And the following operators filled between symbols: & ...

Binomial Coefficient in JAVA

Write a function that accepts two parameters n and k, and returns the value of the Binomial Coefficient C(n, k). Solution: 1. static...

Minimum Cost Path in Matrix

In a matrix you have to find the minimum cost path to reach the last cell from the first one, meaning that starting from the top left...

Minimum Cost Polygon Triangulation in C++

Having a given polygon, divide it using triangulation between all points, having the minimum cost. This means that we have to divide the...

Maximum Length Chain of Pairs in C++

The maximum length chain of pairs is a variation of the longest increasing subsequence problem. We have to find the pairs of numbers that...

Longest Increasing Sub-sequence in C++

Using this algorithm we can find the longest increasing subsequence from a given array. This means that we will find the numbers that are...

Longest common subsequence algorithm in C++

Having two strings, you have to find the longest common subsequence. This means that you have to find how many letters are found in both...

bottom of page