Converting a sorted doubly linked list to a BST
问题 How can a sorted doubly linked list be converted to a balanced binary search tree. I was thinking of doing this the same way as converting an array to a balanced BST. Find the centre and then recursively convert the left part and the right part of the DLL. For example, 1 2 3 4 5 => 1 2 (3) 4 5 => 3 / \ 2 4 / \ 1 5 This is leads to the recurrence T(n) = 2T(n/2) + O(n). O(n) is for finding the centre. The time complexity is therefore O(nlogn). I was wondering if there is an algorithm that does