Click here to Skip to main content
15,886,788 members
Home / Discussions / C#
   

C#

 
GeneralRe: DataGridView binding Pin
sarilee10-Apr-08 21:09
sarilee10-Apr-08 21:09 
GeneralRe: DataGridView binding Pin
Shekelele11-Apr-08 4:24
Shekelele11-Apr-08 4:24 
QuestionVideo motion detection and cursor movement Pin
=Momi=10-Apr-08 9:52
=Momi=10-Apr-08 9:52 
GeneralRe: Video motion detection and cursor movement Pin
Christian Graus10-Apr-08 13:00
protectorChristian Graus10-Apr-08 13:00 
QuestionBitmap + Clipboard + Transparency = Blue Background? Pin
Chadwick Posey10-Apr-08 9:49
Chadwick Posey10-Apr-08 9:49 
AnswerRe: Bitmap + Clipboard + Transparency = Blue Background? Pin
Christian Graus10-Apr-08 13:03
protectorChristian Graus10-Apr-08 13:03 
GeneralVeryfy user and password agains a windows account Pin
Ola E10-Apr-08 9:11
Ola E10-Apr-08 9:11 
GeneralHelp with pseudo code / C# Pin
srmanuel10-Apr-08 8:19
srmanuel10-Apr-08 8:19 
I need help coding the following pseudo code into C#.

The 3 algorithms are search methods for a program which can look through a set of data to find the subsequence of values which add
up to the highest total value.

So for example with the data set.

10 -6 12 -17 9 8 -2

the algorithm(s) show that the "best" value was 17 from array index 4 to array index 5 if you go through it. (9 + 8)

10 - 6 = 4
10 - 6 + 12 = 16
10 - 6 + 12 - 17 = -1
10 - 6 + 12 - 17 + 9 = 8
10 - 6 + 12 - 17 + 9 + 8 = 16
10 - 6 + 12 - 17 + 9 + 8 - 2 = 14
-6 + 12 = 6
-6 +12 -17 = -11
-6 +12 -17 + 9 = -2
etc



For every possible start position // every array index
For every possible end position // rest of array from current start
{
Set subtotal to 0
For every value in subseq // between current start and end
Add profit value to subtotal
Update subseq info when subtotal exceeds current best total
}




For every possible start position...
Set subtotal to 0
For every possible end position...
{
Add end position’s profit value to subtotal
Update subseq if subtotal exceeds current best total
}





Set start position to 0, subtotal to 0
For every profit value... // index from 0 to end of array as end position
{
Add value to subtotal
Keep subseq info (start, end, total) if total exceeds current best
If total is less than 0,
set start position to next index and set total to 0
}

I need help creating C# versions of these methods which compile and run.

Thanks
GeneralRe: Help with pseudo code / C# Pin
Christian Graus10-Apr-08 13:06
protectorChristian Graus10-Apr-08 13:06 
GeneralRe: Help with pseudo code / C# Pin
Guffa10-Apr-08 16:49
Guffa10-Apr-08 16:49 
Generalcheckboxes in datagrids Pin
stephan_00710-Apr-08 7:44
stephan_00710-Apr-08 7:44 
GeneralRe: checkboxes in datagrids Pin
half-life10-Apr-08 8:07
half-life10-Apr-08 8:07 
Questionhow to get and use password of current windows user Pin
stephan_00710-Apr-08 7:36
stephan_00710-Apr-08 7:36 
AnswerRe: how to get and use password of current windows user Pin
nes2world10-Apr-08 8:30
nes2world10-Apr-08 8:30 
AnswerRe: how to get and use password of current windows user Pin
PIEBALDconsult10-Apr-08 9:57
mvePIEBALDconsult10-Apr-08 9:57 
GeneralRe: how to get and use password of current windows user Pin
stephan_00711-Apr-08 7:36
stephan_00711-Apr-08 7:36 
QuestionHow to manipulate other programs? Pin
nes2world10-Apr-08 7:22
nes2world10-Apr-08 7:22 
AnswerRe: How to manipulate other programs? Pin
stephan_00710-Apr-08 7:41
stephan_00710-Apr-08 7:41 
AnswerRe: How to manipulate other programs? Pin
Christian Graus10-Apr-08 13:08
protectorChristian Graus10-Apr-08 13:08 
QuestionHow to retreive the Driver Name Pin
iggydarsa10-Apr-08 6:05
iggydarsa10-Apr-08 6:05 
AnswerRe: How to retreive the Driver Name Pin
Luc Pattyn10-Apr-08 6:25
sitebuilderLuc Pattyn10-Apr-08 6:25 
GeneralRe: How to retreive the Driver Name Pin
iggydarsa10-Apr-08 6:31
iggydarsa10-Apr-08 6:31 
GeneralRe: How to retreive the Driver Name Pin
Luc Pattyn10-Apr-08 7:14
sitebuilderLuc Pattyn10-Apr-08 7:14 
AnswerRe: How to retreive the Driver Name Pin
Eslam Afifi10-Apr-08 6:28
Eslam Afifi10-Apr-08 6:28 
GeneralRe: How to retreive the Driver Name Pin
iggydarsa10-Apr-08 6:34
iggydarsa10-Apr-08 6:34 

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.