Re: Need a Challenge?

new topic     » goto parent     » topic index » view thread      » older message » newer message

On Thursday 16 August 2001 17:18, David Cuny wrote:
>
> Irv Mullins wrote:
> >Wow. The following pgm runs in about 24 seconds; of course, this is a
> >compiled language.
>
> OK, I made a couple of changes to the code.
>
> First, I re-ordered the declaration of constants so they match those in the
> example program. This ensures the comparisons are fair.
>
> Next, I added pruning back into the code. It's rather oblique, but it only
> costs 6 lines of code. That brought the runtime down to about 12 seconds.
>
> Finally, I commented out the redundant tests (those that the pruning
> already took care of). That brought the runtime down to less than 6
> seconds. Of course, my speed is dependant on the processor I used - you'll
> want to run it on your machine for comparison.

Woo hoo! 4.51 seconds here. That's amazing.  I guess it proves that 
the right algorithm is more important than the language.
BTW, that compiled language was alma. Bet no one's ever heard of it.

That particular problem looked like something you'd use Prolog to solve.
Anybody know Prolog?

Regards,
Irv

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu