For this activity you will implement a concucrent merge sort using Akka typed Actors.
Test array is an array with elements from 100000 - 1
Starting Array: 100000, 99999, 99998, 99997, 99996 ... 5, 4, 3, 2, 1
Sorted Array: 1, 2, 3, 4, 5 ... 99996, 99997, 99998, 99999, 100000
define merge_sort(an_array)
if an_array has at most 1 element
return an_array
otherwise
- split an_arry into two halves whose sizes differ by at most 1
- recursively merge_sort each half
- merge the two sorted halves
- return the merged result
define merge(sorted1, sorted2)
result = Array()
i1 = 0
i2 = 0
while i1 < len(sorted1) and
i2 < len(sorted2)
if sorted1[i1] <= sorted2[i2]
add sorted1[i1] to result
i1 = i1 + 1
otherwise
add sorted2[i2] to result
i2 = i2 + 1
if i1 < len(sorted1)
add rest of sorted1 to result
otherwise if i2 < len(sorted2)
add rest of sorted2 to result
return result
Commit and push your solution to the GitHub repository by the due date.