2014年12月21日

摘要: Sort Colors II 原题链接: http://lintcode.com/zh-cn/problem/sort-colors-ii/#Given an array ofnobjects with k different colors (numbered from 1 to k), sort ... 阅读全文
posted @ 2014-12-21 23:53 Yu's Garden 阅读(6936) 评论(11) 推荐(0) 编辑
摘要: Validate Binary Search TreeGiven a binary tree, determine if it is a valid binary search tree (BST).Assume a BST is defined as follows:The left subtre... 阅读全文
posted @ 2014-12-21 21:08 Yu's Garden 阅读(7800) 评论(0) 推荐(1) 编辑
摘要: Longest Common PrefixWrite a function to find the longest common prefix string amongst an array of strings.Show TagsSOLUTION 1:解法很直观。先找到最小长度,然后逐个字母遍历,... 阅读全文
posted @ 2014-12-21 19:15 Yu's Garden 阅读(588) 评论(0) 推荐(0) 编辑

导航