Posted by: rmn on: 14/12/2009
I know I’m a little late, but I’ve only recently discovered the interesting site of projecteuler.net. For anybody not familiar with it, Project Euler is a site offering a vast collection of programming puzzles of mathematical nature for anybody to solve. It has a ranking system for its members, allowing every member to see others’ [...]
Posted by: rmn on: 14/11/2009
There are exactly n! different permutations of n numbers. This challenge was about writing a function which is able to enumerate all these permutations, i.e. function permute(n, idx) which is able to return permutation with index idx of n numbers. The requirement is ofcourse that all these permutations must be unique – this is in [...]
Posted by: rmn on: 05/11/2009
Ever wondered how to reset an entire array of N elements in a constant slice of time? This post will introduce the algorithm along with an implementation. Let me lay out the problem. There’s an array of N integers. We would like to be able to reset that array (set all elements to zero), in [...]
Recent comments