Click here to Skip to main content
15,889,542 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Pseudocode implementation of the strict timestamp protocol for ensuring serializability, recoverability and cascadeless roll-backs Pin
73Zeppelin19-Dec-08 2:30
73Zeppelin19-Dec-08 2:30 
QuestionQuestion from my Phone Interview Pin
BobInNJ15-Dec-08 10:17
BobInNJ15-Dec-08 10:17 
GeneralSum Pin
Luc Pattyn15-Dec-08 11:19
sitebuilderLuc Pattyn15-Dec-08 11:19 
AnswerRe: Question from my Phone Interview Pin
Member 419459315-Dec-08 11:47
Member 419459315-Dec-08 11:47 
AnswerRe: Question from my Phone Interview Pin
Member 419459315-Dec-08 11:49
Member 419459315-Dec-08 11:49 
GeneralRe: Question from my Phone Interview Pin
BobInNJ15-Dec-08 12:43
BobInNJ15-Dec-08 12:43 
GeneralRe: Question from my Phone Interview Pin
Luc Pattyn15-Dec-08 12:52
sitebuilderLuc Pattyn15-Dec-08 12:52 
GeneralRe: Question from my Phone Interview Pin
Member 419459315-Dec-08 13:05
Member 419459315-Dec-08 13:05 
Bob,

I dug back 35 years and came up with the answer. Since the numbers are consecutive, add 1 to 100 into a singe location, then clear another location and add all the numbers in the array. That number will exceed the calculated result by the value of the duplicate number.

This was my solution to a problem in the 60's when we booted the mainframe with a deck of binary cards. The decks became huge (more than 1/2 of a tray of cards) and operators would drop the deck and spend hours trying to insure the deck was back in order(smart operations people always kept a spare deck, just in case). The solution was to initialize a location with 0 and then for each card read, increment the location. The location was then accumulated into a sum, and another location was summed with the actual card sequence number. If the two sums came out the same,then each card had been read once and once only. Appropriate measures had to be taken if a card mis-read caused a backspace and reread (dont consider the card read until you got a good status). The only downsize was that we had to insure that overlay loading was not attempted (could not use the ORG directive to backup into a prior defined table etc then restored). You could never be sure of when in the sequence of loading, any particular location was loaded.

Quite soon after that we went to booting from a tape. Note, we saved an autoload file that was the Startup image, and there was a one card boot that could read in that image instead of the whole boot deck, but when necessary, the deck had to be used - at least until the tape boot became implemented.

Dave.
Generalsum <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Pin
Luc Pattyn15-Dec-08 13:20
sitebuilderLuc Pattyn15-Dec-08 13:20 
GeneralRe: sum <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Pin
Member 419459315-Dec-08 14:43
Member 419459315-Dec-08 14:43 
GeneralRe: sum <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< Pin
riced18-Dec-08 12:47
riced18-Dec-08 12:47 
GeneralNot Cobol Pin
Luc Pattyn18-Dec-08 12:59
sitebuilderLuc Pattyn18-Dec-08 12:59 
GeneralRe: Not Cobol Pin
riced18-Dec-08 13:27
riced18-Dec-08 13:27 
GeneralRe: Not Cobol Pin
Luc Pattyn18-Dec-08 13:39
sitebuilderLuc Pattyn18-Dec-08 13:39 
GeneralRe: Question from my Phone Interview Pin
leonej_dt15-Dec-08 13:33
leonej_dt15-Dec-08 13:33 
AnswerFinding an extra/missing number Pin
supercat918-Dec-08 9:56
supercat918-Dec-08 9:56 
GeneralRe: Question from my Phone Interview Pin
Luc Pattyn18-Dec-08 13:15
sitebuilderLuc Pattyn18-Dec-08 13:15 
GeneralRe: Finding several extra/missing numbers Pin
Luc Pattyn19-Dec-08 1:28
sitebuilderLuc Pattyn19-Dec-08 1:28 
GeneralRe: Finding several extra/missing numbers Pin
supercat919-Dec-08 7:00
supercat919-Dec-08 7:00 
GeneralRe: Finding several extra/missing numbers Pin
Luc Pattyn19-Dec-08 7:25
sitebuilderLuc Pattyn19-Dec-08 7:25 
GeneralRe: Finding several extra/missing numbers Pin
supercat919-Dec-08 8:56
supercat919-Dec-08 8:56 
GeneralRe: Finding several extra/missing numbers Pin
Luc Pattyn19-Dec-08 9:36
sitebuilderLuc Pattyn19-Dec-08 9:36 
GeneralRe: Finding several extra/missing numbers Pin
supercat921-Dec-08 12:28
supercat921-Dec-08 12:28 
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 

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.