Click here to Skip to main content
15,890,438 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Finding an extra/missing number Pin
cp987619-Dec-08 11:46
cp987619-Dec-08 11:46 
GeneralRe: Finding an extra/missing number Pin
Luc Pattyn19-Dec-08 12:48
sitebuilderLuc Pattyn19-Dec-08 12:48 
GeneralRe: Finding an extra/missing number Pin
supercat920-Dec-08 15:57
supercat920-Dec-08 15:57 
GeneralRe: Finding an extra/missing number [modified] Pin
cp987621-Dec-08 13:58
cp987621-Dec-08 13:58 
GeneralRe: Finding an extra/missing number Pin
supercat922-Dec-08 9:58
supercat922-Dec-08 9:58 
GeneralRe: Finding an extra/missing number Pin
Mark Churchill22-Dec-08 18:55
Mark Churchill22-Dec-08 18:55 
GeneralRe: Finding an extra/missing number Pin
supercat923-Dec-08 6:55
supercat923-Dec-08 6:55 
GeneralRe: Finding an extra/missing number Pin
stevepqr8-Jan-09 5:59
stevepqr8-Jan-09 5:59 
Calculate the index sum and the value sum for for the first index.

Compute the difference between the sums - if its zero then the first number is not missing.

Increment the index and recalculate the index sum and the value sum.
Again compute the difference between the sums and also the 2nd difference - if this value is zero then the first missing number has not been found, if the second difference is 1 then the current index is the first missing number.

Continue until the second difference is 2 then the index at this point is the second missing number. etc.

Only 3 variables required (index, index sum, value sum) differences are temporary storage and it works for any number of missing values in a single pass!!

Apathy Rules - I suppose...

Its not the things you fear that come to get you but all the things that you don't expect



AnswerRe: Question from my Phone Interview Pin
C Change25-Jan-09 0:55
C Change25-Jan-09 0:55 
QuestionWhat is Combinatorial Optimization? Pin
alexdow13-Dec-08 9:39
alexdow13-Dec-08 9:39 
AnswerRe: What is Combinatorial Optimization? Pin
Alan Balkany15-Dec-08 3:57
Alan Balkany15-Dec-08 3:57 
QuestionSome kind of LCS Pin
aggressorus9-Dec-08 7:22
aggressorus9-Dec-08 7:22 
Questionhelp me About Big O Pin
bosszy7-Dec-08 2:00
bosszy7-Dec-08 2:00 
GeneralRe: help me About Big O Pin
Luc Pattyn7-Dec-08 6:32
sitebuilderLuc Pattyn7-Dec-08 6:32 
AnswerRe: help me About Big O Pin
Paul Conrad9-Dec-08 11:37
professionalPaul Conrad9-Dec-08 11:37 
GeneralRe: help me About Big O Pin
Luc Pattyn9-Dec-08 13:13
sitebuilderLuc Pattyn9-Dec-08 13:13 
GeneralRe: help me About Big O Pin
Paul Conrad9-Dec-08 13:15
professionalPaul Conrad9-Dec-08 13:15 
AnswerRe: help me About Big O Pin
73Zeppelin10-Dec-08 18:51
73Zeppelin10-Dec-08 18:51 
AnswerRe: help me About Big O Pin
J. Andrew Smith6-Mar-09 3:16
J. Andrew Smith6-Mar-09 3:16 
QuestionCholeski's Algorithm Pin
BobInNJ6-Dec-08 6:06
BobInNJ6-Dec-08 6:06 
AnswerRe: Choleski's Algorithm Pin
73Zeppelin6-Dec-08 6:36
73Zeppelin6-Dec-08 6:36 
GeneralRe: Choleski's Algorithm Pin
BobInNJ7-Dec-08 2:30
BobInNJ7-Dec-08 2:30 
GeneralRe: Choleski's Algorithm Pin
73Zeppelin8-Dec-08 22:40
73Zeppelin8-Dec-08 22:40 
GeneralRe: Choleski's Algorithm Pin
Luc Pattyn6-Dec-08 6:40
sitebuilderLuc Pattyn6-Dec-08 6:40 
QuestionClarke and Wright Algorithm Pin
Hemanth_k5-Dec-08 17:44
Hemanth_k5-Dec-08 17:44 

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.