LeetCode - Convert Sorted List to Binary Search Tree

preview_player
Показать описание
LeetCode - Convert Sorted List to Binary Search Tree

#SortedList #BST #DivideAndConquer

Use the two Pointers that one is fast pointer which makes two steps a time and one is slow pointer which makes one step a time to find the middle node of the sorted LinkedList and convert this middle node to the root node of the BST or BinarySearchTree and recursively performing the same process on the left half and right half of the sorted List to solve this LeetCode Convert Sorted List to Binary Search Tree problem.

Please subscribe, like and comment to let us learn from each other!

Рекомендации по теме