Question: 4. [5 pts.] Consider the following algorithm, findOutside, for finding all the elements of an array A of n numbers that are smaller than a
![4. [5 pts.] Consider the following algorithm, findOutside, for finding all](https://s3.amazonaws.com/si.experts.images/answers/2024/09/66d95ed9f17fb_62566d95ed9612b3.jpg)
4. [5 pts.] Consider the following algorithm, findOutside, for finding all the elements of an array A of n numbers that are smaller than a given value z and larger than another given value y, returning the elements found using a queue data structure implemented using a singly-linked list Algorithm 3 findOutside(A, ,y) 1: new queue, initially empty 2: fori0 ton-1 do 3 if A y then insert(Q, Ali) 5: return Q Give the tightest/best possible characterization, Big-Oh, Big-Theta, or Big-Omega, of the worst-case running time and space complexity of algorithm findOutside as a function of n Justify your answer. Assume the implementation of the insert operation on a queue data structure implemented using a singly-linked list takes time linear in the size of the queue and uses a constant amount of space
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
