Computers and Technology

)given the following algorithm (suppose n can only be even), answer the questions algorithm1(int n, const int s[]) { if (n==2) return; for (int i = 1; i < =n/2; i++) cout< < s[ i ] * s[ i+n/2 ]; } a) what is the output of the algorithm if n = 6, and s[1, 3, 6, 2, 2, 2] b) what is the best case complexity of the algorithm? c) what is the worst case complexity of the algorithm?

answer
Answers: 3

Similar questions

Do you know the correct answer?
)given the following algorithm (suppose n can only be even), answer the questions algorithm1(int n,...

Questions in other subjects:

Konu
Computers and Technology, 26.08.2020 19:01