Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Fastest algorithm Discussion

Name: Anonymous 2008-04-04 16:43

Anyway just for fun and learning I have been messing with algorithms in my head.  Here is the problem:  There is a set of numbers N, Is there a subset of exactly two of them which equal a number Z. 

So for instance, 1,4,6,125,185 and the sum 129.  Would return true. 

What is the fastest exact way to do this for arbitrarily large numbers?

I know one method is to take the largest and smallest (1,129) and move each one up or down depending on < or >.  This method takes O(N) time.

What are the faster algs for this?

Name: Anonymous 2008-04-06 10:27

>>22 is incognizant to the fact that >>18 made an EBCDIC joke.

Actually Haskell uses Unicode which is compatible with ASCII, but jokes don't always have to be technically correct

Name: Anonymous 2008-04-06 10:27

>>22 come back to us when you have at least 10 years of experience with differend flavours of IBM mainframes.

Name: Anonymous 2008-04-06 10:31

>>25
That's such a  long time, I doubt 4chan will be alive then. But I can write you an email.

Name: Anonymous 2008-04-07 11:19

>>24
UTF-8 you mean?

Name: Anonymous 2009-03-06 6:51


Language of choice is   cat and echo.

Name: Anonymous 2011-02-03 4:05

Name: Anonymous 2011-02-04 12:04

Name: Sgt.Kabukiman 2012-05-21 13:57

All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy
 All work and no play makes Jack a dull boy

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List