Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: daixieit

Assignment 1

Tools & Techniques for Large Scale Data Analytics

University of Galway, Academic Year 2022-23

•    Submission deadline (strict): Sunday, 25th September 2022, 23:59 Late submission requires a medical or counsellors certificate.

•    Put all your source code files (and other answers, if any) into a single .zip archive with name YourName_Assignment1.zip and submit via Blackboard by the deadline.

•    Include all source code files (files with name ending .java) required to compile and run your code

•    Create a new Java source code file for each question

•     Unless specified otherwise in the question, use only plain Java for this assignment (no external libraries)

•    All submissions will be checked for plagiarism. In case of plagiarism, both the copier(s) and the provider of the copy (ifit is a student in this class) receive 0 marks on this entire assignment.

•    Use Java comments to explain your own code. Missing or insufficient comments lead to mark deductions. (But no need to add comments to given code.)

You are given on Blackboard (Assessment area) Java code for sorting sequences of Integer objects in increasing order (file New_Sort_Integer_Sequential.java).

Q1.

Modify the given code so that it defines in method main(…) a suitable object of type java.util.Comparator for comparing Integer objects. Remove the entire compare(…) method and utilize the comparator object instead.

[20 marks]

Q2.

Modify the code you created for Q1 so that the comparator object is provided as a Lambda Expression . (Hint: this requires only a very small code modification.)

[20 marks]

Q3.

Modify the code you created for Q2 so that it makes sensible use of parallel computing (using multithreading) inside method sort(…).

You can modify the body of method sort( … ) and, if you like, add parameters to this method .

However, do not change the program or the originally given algorithm otherwise, and do not use any other sorting routine (such as one of Java’s built-in sort approaches).

Use only the traditional” (Java ≤ 7) low-level approach to multithreading for this question (using class Thread explicitly); do not use, e.g., parallel Java 8 Streams.

It is not required that your parallelized code runs actually faster than the original code (no need to run benchmarks) - but you should make use of concurrent threads in a sensible, not naïve, way (hint: keep in mind that sort() is recursive … ).

[60 marks]