Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Below is how the filenames are represented ARRAY]=[50,11,33,21,40,50,40,40,21] Below is the expected output after de-duplication ARRAY ]=[11,21,33,40,50] Also, take a look again at the input

image text in transcribed
Below is how the filenames are represented ARRAY]=[50,11,33,21,40,50,40,40,21] Below is the expected output after de-duplication ARRAY ]=[11,21,33,40,50] Also, take a look again at the input array and be reminded that the input array is not sorted ! Further, please be reminded that you cannot use library functions to either sort and or perform the de-duplication operation. Doing 80 would straight up result in a score of Zero I (1) [100 points] Implement the function in such a way that your solution solves the problem with O(nlog(n))^ ) time complexity overall but stays within the bounds of O(1) space complexity. Here, n is the length of the list of input integers (array). I believe the sorting routine that can be used here is Quick Sort. Please state as code comment which sorting routine you are using, sort the array with that algorithm and solve the de-duplication problem thereafter. De-duplication part of the solution in itself must adhere to O(n) time and O(1) space bounds. However, at this stage of the couree we will not be considering any memory used by recursion. Very Very Importamt : (1) Your code should be well commented which explains all the steps you are performing to solve the problem. A submission without code comments will immediately be deducted 15 points 1 . (2) As a comment in your code, pleare write your test-cases on how you would test your solution atsoumptions and hence your code. A subruission without test cases will immediately be deducted 15 points ! Example of cases to be tested for are like: What if the array input which Es expected does not exist - thint is, input is a null. How should your code handle such in situation? Maybe outpat some message like "Null input 50 forth. Sth of the array is one ?. so on and your tent eases ias: Although, written as comments - You will address

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Graph Databases

Authors: Ian Robinson, Jim Webber, Emil Eifrem

1st Edition

1449356265, 978-1449356262

More Books

Students also viewed these Databases questions

Question

4. What are the current trends in computer software platforms?

Answered: 1 week ago