Given s1, s2, s3, find whether s3 is formed by the interleaving of s1 and s2.For example, Given: s1 = "aabcc", s2 = "dbbca",When s3 = "aadbbcbcac", re... Read More
posted @ 2014-08-06 20:39
Xylophone
Views(120)
Comments(0)
Diggs(0)
Given a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtree of a node contains only n... Read More
posted @ 2014-08-06 11:04
Xylophone
Views(106)
Comments(0)
Diggs(0)
Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note: A solution using O(n) space is... Read More
posted @ 2014-08-06 10:39
Xylophone
Views(172)
Comments(0)
Diggs(0)

浙公网安备 33010602011771号