(ListNode head)
| 11 | class Solution { |
| 12 | // Merge Sort Implementation |
| 13 | public ListNode getMid(ListNode head){ |
| 14 | ListNode slow=head, fast=head.next; |
| 15 | while(fast != null && fast.next != null){ |
| 16 | fast = fast.next.next; |
| 17 | slow = slow.next; |
| 18 | } |
| 19 | return slow; |
| 20 | } |
| 21 | public ListNode merge(ListNode left, ListNode right){ |
| 22 | ListNode dummy = new ListNode(); |
| 23 | ListNode tail = dummy; |