Question: [ 5 pts . ] Formally show that the function f ( n ) = i = 1 n i 2 is O ( n
pts Formally show that the function
is pts Consider the following pseudocode of an algorithm for an operation on a sequence
dataset of realvalued numbers dots, given as input to the algorithm in element
array A representation such that each element for all dots,
a What is the algorithm for Operation computing?
b Provide a tight bigOh runningtime and space characterization of Operation in terms
of Briefly justify your answer. 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 of numbers that are smaller than a given value or larger than
another given value 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 pseudcode, 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 sorted
list 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 FindOutSide Axy
L leftarrow new sorted list initially empty
:
:
:
return L
b Give a tight bigOh time and space characterizations in terms of 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. pts Show that is Justify your answer by a providing
realvalued constant, corresponding to the upperbound constant factors and the integer
constant consistent with the definition of bigOhShow your work. The provided
constants and should follow clearly from your work and be reasonably tight.
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
