Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Definition for singly-linked list.
- * public class ListNode {
- * int val;
- * ListNode next;
- * ListNode(int x) { val = x; }
- * }
- */
- class Solution {
- public ListNode sortList(ListNode head) {
- int stepSize = 2;
- ListNode temp = new Node(0);
- temp.next =
- while(true) {
- ListNode curr = head;
- while(curr->next != null) {
- ListNode curr2 = curr;
- for(int i=0; i<stepSize; i++) curr2 = curr2.next;
- int currStep = 0, curr2Step = 0;
- for(int i=0; i<stepSize; i++) {
- if(curr.val < curr2.val) {
- if(i==0) {
- newHead = curr;
- } else {
- }
- }
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement