- #1
evinda
Gold Member
MHB
- 3,836
- 0
Hello! (Wave)
Consider that we have an algorithm of the form:
When we call
will the command of the if statement (if A[1]==5) be executed? (Thinking)
Consider that we have an algorithm of the form:
Code:
Algorithm(A[1...n], low, high){
mid=low+floor((high-low)/2);
if (A[1]==5) { command }
commands
Algorithm(A,mid+1,high)
}
When we call
Code:
Algorithm(A,mid+1,high)