Pages
(Move to ...)
Home
Info
HowTo
Code
Publications
Finance
Links
Legal
▼
27/02/2018
[Java] Maximise alternate picks on array - dynamic programming
›
Last time we saw how to find the maximum achievable value in a situation where two players alternate in picking items from an array boundar...
24/02/2018
[Java] Maximise alternate picks on array
›
Here's a simple game: gold pots with different amounts of coins are placed in a single line. Two players alternate in choosing one pot t...
23/02/2018
[Java] Loop over digits in a number
›
Well of course we could just convert the number to String and take it up from there, but since we're real men who know about the modulo ...
[Java] Count number of bits set to 1 in a byte type
›
Some more Java byte type related fun, how to count the number of bits set to 1 in a given byte. public int count(){ int tot = 0; ...
[Java] Set a specific bit in a byte type
›
First of all let's start by saying that quite counter intuitively, Boolean in Java is not a single bit but either a 32 or 64 bit entity...
14/02/2018
[Java] Regular expression matcher
›
Regular expressions are a pain, until they are not . Implementing a matcher is a double pain, and possibly the hardest exercise I've se...
[Java] Fisher-Yates array shuffle
›
The Fisher–Yates shuffle is an algorithm for generating a random permutation of a finite sequence. It can be coded to run in-place and in O...
‹
›
Home
View web version