Rearrange a given linked list

Problem: For a given linked list, rearrange it in a defined order.

Problem Explanation: For linked list, 4 -> 5 -> 6 -> 7 -> 8 resembling L0 -> L1 -> … -> Ln-1 -> Ln, rearrange it in the form 4 -> 8 -> 5 -> 7 -> 6  that is L0 -> Ln -> L1 -> Ln-1 -> L2 -> Ln-2

Java Implementation

public class RearrangeLL {
    public void rearrangeLL(Node node) {
        Node x, y, temp;
        x = y = node;

        while (x.getLink() != null && y.getLink() != null 
        && y.getLink().getLink() != null) {
            x = x.getLink();
            y = y.getLink().getLink();
        }

        Node list2 = reverseLL(x.getLink());
        x.setLink(null);
        Node list1 = node;

        node = new Node(0, null);
        temp = node;
        while (list1 != null || list2 != null) {
            if (list1 != null) {
                temp.setLink(list1);
                temp = temp.getLink();
                list1 = list1.getLink();
            }
            if (list2 != null) {
                temp.setLink(list2);
                temp = temp.getLink();
                list2 = list2.getLink();
            }
        }
        node = node.getLink();
        printLL(node);

    }

   public Node reverseLL(Node node) {
        Node cur = node, next = node, prev = null;
        while (cur != null) {
            cur = cur.getLink();
            next.setLink(prev);
            prev = next;
            next = cur;
        }
        return prev;
    }

   public void printLL(Node node) {
        while (node != null) {
            System.out.print(node.getValue());
            node = node.getLink();
        }
    }

    public static void main(String[] args) {
        Node node1 = new Node(4, null);
        node1.setLink(new Node(5, null));
        node1.getLink().setLink(new Node(6, null));
        node1.getLink().getLink().setLink(new Node(7, null));
        node1.getLink().getLink().getLink().setLink(new Node(8, null));
        RearrangeLL rearrangeLL = new RearrangeLL();
        rearrangeLL.rearrangeLL(node1);
    }
}

TimeComplexity: O(n)

Note: If you find any other better way to approach to this problem or you find any issue/error in above code snippets/approaches – please share it in the comments section below and get a chance to enrol free of cost for an online Live Data Structure and Algorithm course (specially designed for interview preparation for software companies like Amazon, Google, Facebook, FlipKart, SnapDeal, HealthKart…)