Question: Algorithm DoSomething (A[0..n-1]) 1. value

Algorithm DoSomething (A[0..n-1]) 1. value <- A[0] 2. i <- 1 3. while (i < n) do 4. if (A[i] > value) 5. value <- A[i] 6. i = i + 1 7. return value

a. Yes or No. The < operation in the line number 3 can be a basic operation. b. Yes or No. The + operation in the line number 6 can be a basic operation.

Algorithm DoSomething (n) 1. i <- 0 2. while (i < n) do 3. j <- 0 4. while (j < n) do 5. write '*' 6. j <- j + 1 7. write '/n' 8. i = i + 1 9. return 0

a. Yes or No. The < operation in the line number 2 can be a basic operation. b. Yes or No. The < operation in the line number 4 can be a basic operation.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!