java implementations of merge-sort in this sectionwe present two java implementations of the merge-sort algorithmone for lists and the other for arrays recursive list-based implementation of merge-sort in code fragment we show complete java implementation of the listbased merge-sort algorithm as static recursive methodmergesort comparator (see section is used to decide the relative order of two elements in this implementationthe input is listland auxiliary listsl and are processed by the recursive calls each list is modified by insertions and deletions only at the head and tailhenceeach list update takes ( timeassuming the lists are implemented with doubly linked lists (see table in our codewe use class nodelist (code fragments for the auxiliary lists thusfor list of size nmethod mergesort( ,cruns in time (nlognprovided the list is implemented with doubly linked list and the comparator can compare two elements of in ( time