RE: Looking for help with a complex algorithm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 2007-10-10 at 07:00 -0500, Jay Blanchard wrote:
>
> There is another ongoing thread about OOP in PHP4 that has approached
> holy war status. I fear that some are overlooking solutions to problems
> that already have been solved. Things such as interfaces and design
> patterns exist because they are solutions to problems just as
> identifying the right problem here leads to a solution (the algorithm).

This is why in computer science they expose you to a lot of different
kinds of algorithms and have you determine their complexity. And when I
say complexity I don't mean complexity to implement, I mean run-time
complexity. As has been pointed out, the knapsack problem has
exponential complexity and therefore will almost certainly suck for any
moderately large data set-- regardless of who provides you with a
solution :)

As for interfaces and design patterns, these are more subjective than
pure solutions and that is why they are open prone to Jihad :) This is
more akin to implementations of the knapsack solution than it is to the
knapsack algorithm itself. As someone pointed out, all programming
languages are Turing complete and as such any language can solve the
problems another language solves. This is easy to visualize when you
know that all languages must be converted to machine language to run. As
such they are all equivalent. There is nothing possible in OOP that is
not possible in assembler. However, there is often great convenience in
using some of the higher level constructs, but as with anything
subjective, your mileage may vary.

Cheers,
Rob.
-- 
...........................................................
SwarmBuy.com - http://www.swarmbuy.com

    Leveraging the buying power of the masses!
...........................................................

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux