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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started