Mar 4 2010

When performance matters

Linked Lists, Double Linked Lists, Arrays, Queues, Stacks… the data structures go on and on, but don’t they all do pretty much the same thing? If you’re like me you probably don’t worry about which you use most the time. Just use whatever is convenient at the time, in C-like languages this will usually be an array, in Functional Languages a List (I believe they use linked lists by default).

Usually the defaults are fine, I mean how much difference could it really make? I didn’t think it would be too much, maybe a couple seconds until my recent experience with Project Euler 78.
Continue reading


Jun 14 2009

Project Euler | Problem Ten

Problem Ten

The problem is to find the sum of all the primes below 2 million.
Continue reading


May 28 2009

Project Euler | Problem Four

Problem Four

A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.

Find the largest palindrome made from the product of two 3-digit numbers.
Continue reading


May 28 2009

Project Euler | Problem Three

Problem Three

The prime factors of 13195 are 5, 7, 13 and 29.

What is the largest prime factor of the number 600851475143 ?

Continue reading


May 27 2009

Project Euler | Problem Two

Problem Two

Each new term in the Fibonacci sequence is generated by adding the previous two terms. By starting with 1 and 2, the first 10 terms will be:

1, 2, 3, 5, 8, 13, 21, 34, 55, 89, …

Find the sum of all the even-valued terms in the sequence which do not exceed four million.

Continue reading


May 27 2009

Project Euler | Problem One

Problem One

If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

Continue reading