The given pseudo-code below takes an array A = {1, 2, 3, 6, 3, 5, 2, 1, 5, 6, 11, 2, 4, 2} of n positive integers (n = 14 in this example) as input and uses an initially empty stack S as an internal variable.
t ↠0
for (i=0; i<n; i++) do {
if (A[i] mod 2) = 1 then
S.push(A[i])
}
while S.size() > 0 do {
k = S.pop()
t ↠t + k
}
print t
a) What is the output for the algorithm with the given input?
b) Big O running time?