[ 3 / biz / cgl / ck / diy / fa / ic / jp / lit / sci / vr / vt ] [ index / top / reports ] [ become a patron ] [ status ]
2023-11: Warosu is now out of extended maintenance.

/sci/ - Science & Math

Search:


View post   

>> No.2187602 [DELETED]  [View]
File: 33 KB, 300x375, benji.jpg [View same] [iqdb] [saucenao] [google]
2187602

>>2187509
numbers = [ 34, 34, 23, 56]
results in
56
[2, 1, 1, 1]

Ok - so 56 is wrong. Algorithm does not work for sequence size 4. Not a big deal. We are not nitpickers.

So your algorithm calculates the first move and recursively turns back for a sub sequence.

Let's just try it in old dumb way - I'll just run your program.
n=12
operations = 36*25*16*9*4=518400

That is FAR FROM O(n^2). It is rather something O(2^(n+-something))

You just got schooled hard and you suggest I should go back to school.

>> No.2173910 [View]
File: 33 KB, 300x375, benji.jpg [View same] [iqdb] [saucenao] [google]
2173910

What happened? /sci/ went full retarded within last hour or so. Is /sci/ being raided?

Navigation
View posts[+24][+48][+96]