Question: need these answers please, thanks 1. [ 30 points] Implement the function hasDuplicates in the class to DuplicateWordFinder. Input will be given as a line

need these answers please, thanks
need these answers please, thanks 1. [ 30 points] Implement the function

1. [ 30 points] Implement the function hasDuplicates in the class to DuplicateWordFinder. Input will be given as a line containing a positive integer n, followed by n rows, each containing a string. Output should be either the word true if there are any duplicates among these strings or false if there are not. Your code should work well on long lists of strings. (You might use java built-in method ".equals ()".) For example, input \{spring, summer, fall, summer, winter\} will return true; input \{spring. summer, fall, winter; will return false. 2. [40 points] Implement the function sortFlowers. Input will be given as a line containing a positive integer n, followed by n rows, each containing a flower name (string) which always starts with capital letter (e.g., "Rose", but not "rose"). The program should sort the flower names in Alphabetical order. In this exercise you can assume that the capital letters of flower names are all different. You can make your choice to use any one of sorting algorithm from bubble sort, selection sort or insertion sort. (You might use java built-in method ".charAt()".) For example, input { Rose, Lily, Tulip\} will return {Lily, Rose, Tulip }. 3. [ 30 points] In this problem, your task is to complete the reverseArray0 method. You will write a method to reverse an array of integers. Your algorithm should use O(1) space beyond the input (any algorithms that use space not in O(1) will receive half credit at most). You may not use any library functions in this question (any solutions that do will receive zero credit). Your program should accept as input an array of integers and output another array of integers that contains the original elements in reversed order. For example, the input {3,4,7, 6,1} should result in printing the output {1,6,7,4,3}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!