Feeds:
Posts
Comments

Archive for the ‘algorithms’ Category

Project Euler

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’ [...]

Read Full Post »

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 [...]

Read Full Post »

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 [...]

Read Full Post »