Tuesday, March 5, 2013

Convert Sorted List to Binary Search Tree


Convert Sorted List to Binary Search TreeOct 3 '12
Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST. Algorithm with inorder traversal avoiding the need to traverse the linked list for midpoint that is required for the previous algorithm with preorder traversal.

No comments:

Post a Comment