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

Algorithm

Name: Anonymous 2010-10-21 11:53

There's a n-element array of integers- 1 or 2.
We have to find subsequence which sum equals x.
How to do that ? I have no fucking idea.
Inb4 bruteforce

Name: Anonymous 2010-10-22 3:45

>>36
OKAY YOU FUQIN ANGERED AN EXPERT PROGRAMMER

The algorithm in >>18 is a O(n) solution to the problem of finding a continuous subsequence of an array of integers, whose sum is equal to a certain integer. The reason why it's O(n) is because you don't recompute the sum of the subsequence A[i:j] every time you move through the array, you just use the previous one.

You don't fuqin believe me? Implement >>18's algorithm and see for yourself, ``faggot''.

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