Click here to Skip to main content
15,901,426 members
Home / Discussions / C#
   

C#

 
GeneralRe: Get number of copies from Win32_PrintJob Pin
Anonymous29-Mar-05 5:13
Anonymous29-Mar-05 5:13 
GeneralRe: Get number of copies from Win32_PrintJob Pin
Anonymous29-Mar-05 11:04
Anonymous29-Mar-05 11:04 
QuestionHow to backup database and restore database using C# Pin
pubududilena29-Mar-05 3:18
pubududilena29-Mar-05 3:18 
AnswerRe: How to backup database and restore database using C# Pin
Sebastian Schneider29-Mar-05 3:23
Sebastian Schneider29-Mar-05 3:23 
GeneralRe: How to backup database and restore database using C# Pin
pubududilena29-Mar-05 3:33
pubududilena29-Mar-05 3:33 
Questionhow to get minimum value & maximum value from array Pin
montu337729-Mar-05 2:41
montu337729-Mar-05 2:41 
AnswerRe: how to get minimum value & maximum value from array Pin
Guinness4Strength29-Mar-05 2:49
Guinness4Strength29-Mar-05 2:49 
AnswerRe: how to get minimum value & maximum value from array Pin
DavidNohejl29-Mar-05 3:11
DavidNohejl29-Mar-05 3:11 
it's not that difficult. If it's generic array, and you don't have any specific information about array (specific information would be e.g. "it's sorted array"), you have to go through whole array - that's common sense. You can optimize this stupid algorithm only if you know something more... As already suggested, you could keep a variable with maximal/minimal value. Or you can have sorted array. Or if you need better performance (e.g. it's BIG array - I can think of sizes 1000+ ) you may consider different structure than array - heap, tree etc. Or you can sort array once and then find min and max is easy and in O(1). It really depends on what is in array and how you use the array... without more information, answer is you can't do anything better then O(N) (meaning: check all N items in array).

David

Never forget: "Stay kul and happy" (I.A.)

David's thoughts / dnhsoftware.org / MyHTMLTidy
GeneralRe: how to get minimum value & maximum value from array Pin
montu337729-Mar-05 3:27
montu337729-Mar-05 3:27 
GeneralRe: how to get minimum value & maximum value from array Pin
Guinness4Strength29-Mar-05 3:56
Guinness4Strength29-Mar-05 3:56 
GeneralRe: how to get minimum value & maximum value from array Pin
montu337729-Mar-05 5:33
montu337729-Mar-05 5:33 
GeneralRe: how to get minimum value & maximum value from array Pin
Guinness4Strength29-Mar-05 5:57
Guinness4Strength29-Mar-05 5:57 
GeneralRe: how to get minimum value & maximum value from array Pin
montu337729-Mar-05 23:44
montu337729-Mar-05 23:44 
GeneralRe: how to get minimum value & maximum value from array Pin
Guinness4Strength30-Mar-05 3:37
Guinness4Strength30-Mar-05 3:37 
GeneralRe: how to get minimum value & maximum value from array Pin
montu337730-Mar-05 4:01
montu337730-Mar-05 4:01 
AnswerRe: how to get minimum value & maximum value from array Pin
Tom Larsen29-Mar-05 4:15
Tom Larsen29-Mar-05 4:15 
GeneralButton component not visible with Thread Pin
ESTAN29-Mar-05 2:28
ESTAN29-Mar-05 2:28 
GeneralHaving Problem in a Remoting call Pin
Muhammad Ahmed29-Mar-05 1:39
Muhammad Ahmed29-Mar-05 1:39 
GeneralRe: Having Problem in a Remoting call Pin
Kodanda Pani29-Mar-05 20:46
Kodanda Pani29-Mar-05 20:46 
GeneralRe: Having Problem in a Remoting call Pin
Muhammad Ahmed30-Mar-05 19:27
Muhammad Ahmed30-Mar-05 19:27 
GeneralWeird Connstring problem Pin
Adnan Siddiqi29-Mar-05 1:21
Adnan Siddiqi29-Mar-05 1:21 
GeneralRe: Weird Connstring problem Pin
Guinness4Strength29-Mar-05 3:00
Guinness4Strength29-Mar-05 3:00 
GeneralRe: Weird Connstring problem Pin
Dave Kreskowiak29-Mar-05 4:41
mveDave Kreskowiak29-Mar-05 4:41 
Generalwarping a bitmap Pin
gozza1129-Mar-05 1:17
gozza1129-Mar-05 1:17 
GeneralRe: warping a bitmap Pin
Sebastian Schneider29-Mar-05 2:26
Sebastian Schneider29-Mar-05 2:26 

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.