Skip to content

In this repo, I tried to implement the MergeSort in multiple ways.

Notifications You must be signed in to change notification settings

hakunamatata97k/MergeSort_Implementations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 

Repository files navigation

MergeSort Implementations

Build Status

In this repo I tried my best to implement the MergeSort in various ways:


Papers/Books I've read:

A) BOOK What's New in java 8 to read it please refer here.

B) In order to maximize the understanding of mergesort and it's implementations i've read your pdfs and the following papers from open-scources:

C) In order to optimize the code I did read the following:


Problems encountered me through the Coding per exercise:

Exercise 2: (Contains unreviewed Issue)
  • I could NOT understand the logic behind terminating the threads via a boolean flag and synchronized method!.
  • understanding the Amdahl's law.
  • I learned that lambdas are not to be treated as Anonymous classes thus according to the book What's New in java 8 :

    A lambda expression is not an anonymous class; it actually uses invokedynamic in the byte-code.

Exercise 3:
  • the trouble i went throught could be observed in this StackOverFlow Question (asked and answered by me).

  • Choosing the right Threadpool that will alow the program to work freely without having any memory issues when sorting big data such like 1000.000 .

    • newCachedThreadPool worked till some amount of data i think 70000then melt down happend.
    • newFixedThreadPool failed miserably thus the program would be in hold whenever the threads are busy.
    • newWorkStealingPoolworked like a charm due to the fact that the workStealing according to the javaDoc:

      "creates a work-stealing thread pool using all available processors as its target parallelism level."

  • managing the Sorting without wasting objects by making the `sort(LinkedList data) static.

Exercise 4:
  • was in general not hard to implement and as in the pervious exercise i had to make the `sort(LinkedList data) method static.

Time Analysis here


About

In this repo, I tried to implement the MergeSort in multiple ways.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages