← ALL NOTES
Linked List

109. Convert Sorted List to Binary Search Tree

The catch versus the array version (#108) is that a linked list has no O(1) middle. One neat way around it: count the nodes to get n, build an empty balanced skeleton of that size, then fill in the…

Loading…