Share a consise recursive solution in C++
\n The recursive idea have been posted by yucheng.wang. Given a example, 1->2->3->4->5, the solution will reorder node(3),  then reorder 2 and 4 to have (2->4->
\n The recursive idea have been posted by yucheng.wang. Given a example, 1->2->3->4->5, the solution will reorder node(3),  then reorder 2 and 4 to have (2->4->3), then 1 and 5 get have 1->5->2->4->3. Each call of reorderList(ListNode* head, int len) will return the last element after this reorderList() call.\n\n   int getLength(ListNode *head){\n        int len = 0;\n        while( head != NULL ){\n            ++len;  head = head->next;\n        }\n        return len;\n    }\n    \n    ListNode * reorderList(ListNode *head, int len){\n        if(len == 0)\n            return NULL;\n        if( len == 1 )\n            return head;\n        if( len == 2 )\n            return head->next;\n        ListNode * tail = reorderList(head->next, len-2);\n        ListNode * tmp = tail->next;\n        tail->next = tail->next->next;\n        tmp->next = head->next;\n        head->next = tmp;\n        return tail;\n    }\n    \n    void reorderList(ListNode *head) {  //recursive\n        ListNode  * tail = NULL;\n        tail = reorderList(head, getLength(head));\n    }
[]