public void reorderList(ListNode head) {
        Stack<ListNode> stack = new Stack<ListNode>();
        Queue<ListNode> queue = new LinkedList<ListNode>();
        ListNode node = head;
        int size = 0;
        while(node != null){
            size++;
            stack.add(node);
            queue.add(node);
            node = node.next;
        }
        int i =0 ;
        node = new ListNode(-1);
        while(i < size/2){
            node.next = queue.poll();
            node = node.next;
            node.next = stack.pop();
            node = node.next;
        }
        if(size % 2 == 1){
            node.next =queue.poll();
            node = node.next;
        }
        node.next = null;
    }