SHARE
TWEET

Untitled

a guest May 23rd, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /**
  2.  * Definition for singly-linked list.
  3.  * public class ListNode {
  4.  *     int val;
  5.  *     ListNode next;
  6.  *     ListNode(int x) { val = x; }
  7.  * }
  8.  */
  9. class Solution {
  10.     public ListNode sortList(ListNode head) {
  11.         int stepSize = 2;
  12.         ListNode temp = new Node(0);
  13.         temp.next =
  14.         while(true) {
  15.             ListNode curr = head;
  16.             while(curr->next != null) {
  17.                 ListNode curr2 = curr;
  18.                 for(int i=0; i<stepSize; i++) curr2 = curr2.next;
  19.                 int currStep = 0, curr2Step = 0;
  20.                 for(int i=0; i<stepSize; i++) {
  21.                     if(curr.val < curr2.val) {
  22.                         if(i==0) {
  23.                             newHead = curr;
  24.                         } else {
  25.                            
  26.                         }
  27.                     }
  28.                 }
  29.             }
  30.         }
  31.        
  32.     }
  33. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top