本文共 364 字,大约阅读时间需要 1 分钟。
class Solution { public: bool VerifySquenceOfBST(vector sequence) { if (!sequence.size()) return false; return IsBST(sequence, 0, sequence.size()-1); } bool IsBST( vector & sequence, int start, int end){ if (start>=end) return true; // 可能出现start>end的情况 int p; for (p=start; sequence[p]
转载地址:http://knklf.baihongyu.com/