Click here to Skip to main content
15,921,841 members
Home / Discussions / Algorithms
   

Algorithms

 
GeneralRe: An algorithm checking balance of html tags Pin
Gerry Schmitz5-Jun-18 8:02
mveGerry Schmitz5-Jun-18 8:02 
GeneralRe: An algorithm checking balance of html tags Pin
Richard Deeming6-Jun-18 1:15
mveRichard Deeming6-Jun-18 1:15 
GeneralRe: An algorithm checking balance of html tags Pin
Eddy Vluggen6-Jun-18 1:24
professionalEddy Vluggen6-Jun-18 1:24 
GeneralRe: An algorithm checking balance of html tags Pin
Richard Deeming6-Jun-18 1:26
mveRichard Deeming6-Jun-18 1:26 
GeneralRe: An algorithm checking balance of html tags Pin
Eddy Vluggen6-Jun-18 1:39
professionalEddy Vluggen6-Jun-18 1:39 
GeneralRe: An algorithm checking balance of html tags Pin
Gerry Schmitz6-Jun-18 5:42
mveGerry Schmitz6-Jun-18 5:42 
GeneralRe: An algorithm checking balance of html tags Pin
Richard Deeming6-Jun-18 5:53
mveRichard Deeming6-Jun-18 5:53 
GeneralRe: An algorithm checking balance of html tags Pin
Gerry Schmitz6-Jun-18 6:25
mveGerry Schmitz6-Jun-18 6:25 
QuestionRecursive Best First Search for Pathfinding? Pin
Robert Vandenberg Huang26-May-18 3:29
professionalRobert Vandenberg Huang26-May-18 3:29 
AnswerRe: Recursive Best First Search for Pathfinding? Pin
Gerry Schmitz29-May-18 7:20
mveGerry Schmitz29-May-18 7:20 
AnswerRe: Recursive Best First Search for Pathfinding? Pin
Member 1386820111-Jun-18 16:25
Member 1386820111-Jun-18 16:25 
QuestionWhich one is better O(V+E) or O(ElogE)? Pin
Member 138067031-May-18 8:14
Member 138067031-May-18 8:14 
AnswerRe: Which one is better O(V+E) or O(ElogE)? Pin
Gerry Schmitz2-May-18 8:39
mveGerry Schmitz2-May-18 8:39 
AnswerRe: Which one is better O(V+E) or O(ElogE)? Pin
Lauren Ragsdale3-May-18 8:06
Lauren Ragsdale3-May-18 8:06 
QuestionProblem with understanding aes gcm algorithm Pin
Member 1380418229-Apr-18 16:14
Member 1380418229-Apr-18 16:14 
AnswerRe: Problem with understanding aes gcm algorithm Pin
Richard MacCutchan29-Apr-18 21:26
mveRichard MacCutchan29-Apr-18 21:26 
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 

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.