Click here to Skip to main content
15,914,642 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: O(my) Pin
harold aptroot1-Aug-15 10:17
harold aptroot1-Aug-15 10:17 
GeneralRe: O(my) Pin
PIEBALDconsult1-Aug-15 17:04
mvePIEBALDconsult1-Aug-15 17:04 
GeneralRe: O(my) Pin
CPallini1-Aug-15 10:33
mveCPallini1-Aug-15 10:33 
GeneralRe: O(my) Pin
Daniel Pfeffer1-Aug-15 21:39
professionalDaniel Pfeffer1-Aug-15 21:39 
GeneralRe: O(my) Pin
PIEBALDconsult1-Aug-15 22:00
mvePIEBALDconsult1-Aug-15 22:00 
GeneralRe: O(my) Pin
Daniel Pfeffer1-Aug-15 22:45
professionalDaniel Pfeffer1-Aug-15 22:45 
GeneralRe: O(my) Pin
harold aptroot2-Aug-15 1:58
harold aptroot2-Aug-15 1:58 
GeneralRe: O(my) Pin
PIEBALDconsult2-Aug-15 6:33
mvePIEBALDconsult2-Aug-15 6:33 
harold aptroot wrote:
The maximum subarray thing?


Yes, shhhh... I didn't want to make this a programming discussion. Big Grin | :-D


Thanks for pointing me to Kadane's algorithm -- I didn't know about it and I see that it is indeed O(n). My implementation is ummm... not. Unsure | :~
But then, the OP was given a more complex problem to solve anyway.

So I didn't get to O(n), but I got some good exercise in C and that's what I wanted.
And I implemented the "larger" problem of being able to tell you exactly which members of the array are involved in the greatest (and longest) subarray sum.

I don't think it's O(n^2) and I suppose I shouldn't have said O(n!). I think it's more like O(1+2+...n), but there's no name for that is there?

I'll continue to think about it and maybe there is an actual O(n) algorithm for this.


harold aptroot wrote:
wtf they're talking about with their divide and conquer


I suspect that a shark has been jumped. The code complexity would far outweigh the problem complexity.
GeneralRe: O(my) Pin
harold aptroot2-Aug-15 6:41
harold aptroot2-Aug-15 6:41 
GeneralRe: O(my) Pin
PIEBALDconsult2-Aug-15 6:46
mvePIEBALDconsult2-Aug-15 6:46 
GeneralRe: O(my) Pin
PIEBALDconsult2-Aug-15 8:34
mvePIEBALDconsult2-Aug-15 8:34 
GeneralO(yes^3) Pin
Bassam Abdul-Baki4-Aug-15 7:20
professionalBassam Abdul-Baki4-Aug-15 7:20 
GeneralHow Disciplined Of A Coder Are You? PinPopular
Kevin Marois1-Aug-15 8:18
professionalKevin Marois1-Aug-15 8:18 
GeneralRe: How Disciplined Of A Coder Are You? Pin
PIEBALDconsult1-Aug-15 8:35
mvePIEBALDconsult1-Aug-15 8:35 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Kevin Marois1-Aug-15 8:47
professionalKevin Marois1-Aug-15 8:47 
GeneralRe: How Disciplined Of A Coder Are You? Pin
newton.saber1-Aug-15 10:28
newton.saber1-Aug-15 10:28 
GeneralRe: How Disciplined Of A Coder Are You? Pin
pkfox1-Aug-15 21:10
professionalpkfox1-Aug-15 21:10 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Ravi Bhavnani1-Aug-15 8:35
professionalRavi Bhavnani1-Aug-15 8:35 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Kevin Marois1-Aug-15 8:42
professionalKevin Marois1-Aug-15 8:42 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Ravi Bhavnani1-Aug-15 8:45
professionalRavi Bhavnani1-Aug-15 8:45 
GeneralRe: How Disciplined Of A Coder Are You? Pin
PIEBALDconsult1-Aug-15 9:20
mvePIEBALDconsult1-Aug-15 9:20 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Gjeltema1-Aug-15 12:10
Gjeltema1-Aug-15 12:10 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Camilo Reyes1-Aug-15 14:09
professionalCamilo Reyes1-Aug-15 14:09 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Mycroft Holmes1-Aug-15 14:29
professionalMycroft Holmes1-Aug-15 14:29 
GeneralRe: How Disciplined Of A Coder Are You? Pin
Mike Hankey1-Aug-15 9:09
mveMike Hankey1-Aug-15 9:09 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.