top of page
Caută

Weighted Job Scheduling in JAVA

You receive a list of jobs that have three elements: start time, finish time and profit. You have to schedule the jobs with no...

Tiling Problem in JAVA

You can use a board that is 2 x n size. The tiles are of size 2 x 1. Count the number of ways to tile the board. Tiles can be placed...

Subset Sum Problem in JAVA

Given a set of non-negative integers, and a value sum, determine if there is a subset of the given set with the sum equal to the given...

Shortest Common Supersequence in JAVA

Given two strings as input, the task is to find the length of the shortest string that has both strings as subsequences. Solution: 1. ...

Palindrome Partitioning in JAVA

Starting from a string, we determine it’s a palindrome partitioning by diving it into substrings, each being a palindrome. In our problem...

Mobile Numeric Keypad Problem in JAVA

We use a mobile numeric keyboard. You can only press buttons that are up, left, right or down to the current button. You are not allowed...

Minimum Cost Polygon Triangulation in JAVA

You must find the minimum cost triangulation of a convex polygon. A triangulation is formed by drawing diagonals between nonadjacent...

Maximum Sum Increasing Subsequence in JAVA

You are given an array of positive integers. You must write a program that will return the sum of the maximum sum subsequence of the...

Maximum Length Chain of Pairs in JAVA

You receive as input n pairs of numbers. In every pair, the first number is smaller than the second one. A chain of pairs (a, b), (c, d)...

Longest Palindromic Substring in JAVA

Starting from a string, we have to find the longest substring which is a palindrome. Solution: 1. static String...

Longest Palindromic Subsequence in JAVA

Given a sequence of letters, find the length of the longest palindromic subsequence in it. Solution: 1. public static void main(String[]...

Longest Bitonic Subsequence in JAVA

A Bitonic Subsequence is a part of a sequence that is formed first by increasing numbers, and after that by decreasing numbers. Write a...

bottom of page