Biting Code

tutorial-like examples and some informal chatting on Java, JavaScript, other programming languages, and more.

Knapsack without repetition

›
Similarly to the previous problem , we have a knapsack with a specified capacity, a number of items with different weight and value, and we ...

Knapsack with repetitions

›
We are given a set of items, each of them having a weight and a value, and a knapsack with a specified capacity. Each item is available in a...

Levenshtein distance

›
Given two strings, return its Levenshtein distance, i.e. the minimum number of character changes needed to mutate the first string in the se...

Minimum number of coins to make change

›
We should give a certain amount back, and we want minimize the number of coins involved in the operation, accordingly to the available denom...

Greatest Common Divisor

›
Given two integers, find their greatest common divisor. If you don't know the Euclid algorithm, you should get to a piece of code like...

Last digit of a Fibonacci number

›
The Fibonacci sequence leads rapidly to such huge values that it gets difficult even to think to a monster like Fibonacci of one million. Ho...

Add testing to a Maven project

›
This post was not so obsolete as the previous two ones, however it referred to JUnit 4, while the most interesting point in the argument, I ...
›
Home
View web version
Powered by Blogger.