Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

n todays Lab we will explore ways to do a de-duplication of videos where video filenames are presented as integers. For the purposes of our

n today’s Lab we will explore ways to do a de-duplication of videos where video filenames are presented as integers. For the purposes of our task, we will 1 set a very narrow criterion for de-duplication: just the filenames.

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]

ATTN: Notice the reduced size of the output array. 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 perform the de-duplication operation. Doing so would straight up result in a score of Zero! You will solve the problem in two ways:-

(1) [50 points] Implement the function in such a way that your solution solves the problem with O(n 2 ) time complexity overall and O(1) space complexity. Here, n is the length of the list of input integers (array). In this part of the problem, you will be using the Selection Sort Algorithm that we covered in class. Please 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. (2) [50 points] In a separate implementation, code up a solution in such a way that your solution solves the problem with O(n 2 ) time complexity overall and stays within the bounds of O(1) space complexity. Here, n is the length of the list of input integers (array). In this part of the problem you will be using the Bubble Sort Algorithm that we covered in class. Please 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.

[50 points] In a separate implementation, code up a solution in such a way that your solution solves the problem with O(n 2 ) time complexity overall and stays within the bounds of O(1) space complexity. Here, n is the length of the list of input integers (array). In this part of the problem, you will be using the Bubble Sort Algorithm that we covered in class. Please 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.

Very Very Important :

(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 ! 2 (2) As a comment in your code, please write your test cases on how you would test your solution assumptions and hence your code. A submission without test cases will immediately be deducted 15 points! Examples of cases to be tested for are like: What if the array input which is expected does not exist - that is , input is a null. How should your code handle such a situation? Maybe output some message like ”Null input case, so no output”? What if the length of the array is one ?....so on and so forth. Please Remember: Although written as comments - You will address your test cases in the form of code and not prose :)

The preferred coding language is JAVA and it should take In the user input like using the Scanner method

Step by Step Solution

3.62 Rating (163 Votes )

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

Financial Reporting Financial Statement Analysis And Valuation A Strategic Perspective

Authors: James M. Wahlen, Stephen P. Baginski, Mark Bradshaw

8th Edition

1285190904, 978-1305176348, 1305176340, 978-1285190907

More Books

Students also viewed these Programming questions

Question

=+ Do you see any potential problems with the analysis?

Answered: 1 week ago

Question

8. Name the three catecholamine neurotransmitters.

Answered: 1 week ago

Question

14. State the all-or-none law.

Answered: 1 week ago