Recursion expression to express running time of pseudo code that finds number of instances of int K in array of ints Arr

81 Views Asked by At

Pseudo Code

Algorithm: findInstances(Arr, k)
    if Arr.length = 0 then return 0
    if Arr[0] = k then return 1+findInstances(Arr.slice(1), k)
    return findInstances(Arr.slice(1), k)

Im looking for T(n) which I would then solve for using induction. I was thinking enter image description here