Question: [ 1 0 pts . Detecting anomalies in a data set is an important task in data science. One approach to anomaly detection involves the
pts Detecting anomalies in a data set is an important task in data science. One approach to anomaly detection involves the detection, retrieval, and analysis of outliers. A useful subroutine for an algorithm to compute outliers is a function that extracts all the elements of an array A of n numbers that are smaller than a given value a or larger than another given value y all given as input, and returns the elements in A that are in those lower and upper regions ie outside an interval range of the realline using a sortedordered list data structure. Let us call an algorithm for this function FINDOUTSIDE.
a Provide an efficient algorithm, in pseudeode, for the function FINDOUTSIDE described above: complete the stepbystep by writing down the missing statements, already started for you below. Assume that you have available an implementation of the sortedlist ADT which includes the method iNSERT which, taking as input an element, inserts the element in the proper position in the sorted list, and does so in linear time and constant space. Make sure to use indentation to clearly indicate the proper scope of each statement.
Algorithm FINDOUTSIDEA y
: L new sorted list initially empty
:
: return L
b Give a tight bigOh time and space characterizations in terms of n of the algorithm FINDOUTSIDE. Justify your answer. Assume the implementation of the insert operation takes time linear in the size of the sorted list and uses a constant amount of space.
Time
Space
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
