QUESTIONS 1. Find the complexity of the algorithm as Big O notation: countValue(a, n, val) { } count=0 for i=1 to n { if (a[i] = val) count= count + 1 } return count

icon
Related questions
Question
1. Find the complexity of the algorithm as Big O notation:
countValue(a, n, val)
{
}
count=0
for i=1 to n {
if (a[i]=val)
count count + 1
QUESTIONS
}
return count
Transcribed Image Text:1. Find the complexity of the algorithm as Big O notation: countValue(a, n, val) { } count=0 for i=1 to n { if (a[i]=val) count count + 1 QUESTIONS } return count
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer