Click here to Skip to main content
15,887,214 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: Problem with understanding aes gcm algorithm Pin
Member 138041821-May-18 3:41
Member 138041821-May-18 3:41 
GeneralRe: Problem with understanding aes gcm algorithm Pin
Gerry Schmitz1-May-18 5:09
mveGerry Schmitz1-May-18 5:09 
GeneralRe: Problem with understanding aes gcm algorithm Pin
Eddy Vluggen1-May-18 5:20
professionalEddy Vluggen1-May-18 5:20 
QuestionSub-Pixel Edge Detection - Implementing according to Carsten Steger's method. Pin
Member 1378530717-Apr-18 21:03
Member 1378530717-Apr-18 21:03 
QuestionProblem with variation of gas station problem. Pin
Karol Nowak16-Apr-18 2:42
Karol Nowak16-Apr-18 2:42 
AnswerRe: Problem with variation of gas station problem. Pin
Karol Nowak16-Apr-18 22:44
Karol Nowak16-Apr-18 22:44 
AnswerRe: Problem with variation of gas station problem. Pin
Daniel Pfeffer17-Apr-18 22:38
professionalDaniel Pfeffer17-Apr-18 22:38 
QuestionProving an algorithm wrong Pin
Member 1377958614-Apr-18 6:39
Member 1377958614-Apr-18 6:39 
Hello!

So I have this algorithm that outputs the highest value of an array:

Input: A[1,..,n], n>=1
Output: Highest value of an array

Maximum (A)
1. m = A[1]
2. i = 1
3. while i < n
4. if A[i+1] > A[i]
5. m = A[i+1]
6. i = i+1
7. return m

I have to prove this algorithm wrong and I'm confused how to do that, because to me the algorithm seems correct. Any advice on how to do this are very much appreciated.

Thanks!
AnswerRe: Proving an algorithm wrong Pin
Richard Andrew x6415-Apr-18 6:04
professionalRichard Andrew x6415-Apr-18 6:04 
GeneralRe: Proving an algorithm wrong Pin
Gerry Schmitz15-Apr-18 8:05
mveGerry Schmitz15-Apr-18 8:05 
GeneralRe: Proving an algorithm wrong Pin
Richard Andrew x6415-Apr-18 8:26
professionalRichard Andrew x6415-Apr-18 8:26 
GeneralRe: Proving an algorithm wrong Pin
Richard MacCutchan15-Apr-18 21:30
mveRichard MacCutchan15-Apr-18 21:30 
AnswerRe: Proving an algorithm wrong Pin
Jochen Arndt15-Apr-18 21:45
professionalJochen Arndt15-Apr-18 21:45 
GeneralRe: Proving an algorithm wrong Pin
Richard MacCutchan15-Apr-18 22:27
mveRichard MacCutchan15-Apr-18 22:27 
QuestionCan someone please help me optimize(decrease time complexity) this algorithm.. Pin
Member 137677177-Apr-18 10:37
Member 137677177-Apr-18 10:37 
AnswerRe: Can someone please help me optimize(decrease time complexity) this algorithm.. Pin
Patrice T7-Apr-18 20:15
mvePatrice T7-Apr-18 20:15 
QuestionRe: Can someone please help me optimize(decrease time complexity) this algorithm.. Pin
claymorehack18-May-18 3:38
claymorehack18-May-18 3:38 
AnswerRe: Can someone please help me optimize(decrease time complexity) this algorithm.. Pin
Richard MacCutchan18-May-18 5:59
mveRichard MacCutchan18-May-18 5:59 
QuestionAlgorithm for golf putting. Slope 1-4 degrees Pin
Member 1375000827-Mar-18 11:06
Member 1375000827-Mar-18 11:06 
AnswerRe: Algorithm for golf putting. Slope 1-4 degrees Pin
Gerry Schmitz2-Apr-18 6:01
mveGerry Schmitz2-Apr-18 6:01 
Questionrecursive algorithm Pin
Member 1374335523-Mar-18 7:00
Member 1374335523-Mar-18 7:00 
AnswerRe: recursive algorithm Pin
Gerry Schmitz23-Mar-18 12:00
mveGerry Schmitz23-Mar-18 12:00 
AnswerRe: recursive algorithm Pin
Peter_in_278023-Mar-18 14:53
professionalPeter_in_278023-Mar-18 14:53 
QuestionSquare root of positive integer using binary search. Pin
lnikon25-Feb-18 9:40
lnikon25-Feb-18 9:40 
GeneralRe: Square root of positive integer using binary search. Pin
harold aptroot25-Feb-18 10:29
harold aptroot25-Feb-18 10:29 

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.