one optimization could be:
Inorder(big).subString(inorder(small)) == true , then only execute this
logic.
On Friday, 26 October 2012 02:54:14 UTC+5:30, Don wrote:
If T1 is a balanced tree with 50 million nodes, where the value of
each node is 42, and T2 is a tree with 500 nodes with all
If T1 is a balanced tree with 50 million nodes, where the value of
each node is 42, and T2 is a tree with 500 nodes with all values equal
42 except the rightmost node which is 43, these approaches will take a
very long time. Any ideas on how to improve performance in such cases?
Don
On Oct 25,