题目:Given a binary search tree, write a functionkthSmallestto find thekth smallest element in it.Note:You may assume k is always valid, 1 ≤ k ≤ BST's t...
分类:
其他好文 时间:
2015-07-14 15:13:55
阅读次数:
98
题目:Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may assume that the ...
分类:
其他好文 时间:
2015-07-14 15:04:53
阅读次数:
118
Problem Description
As we all know, Fat Brother likes MeiZi every much, he always find some topic to talk with her. But as Fat Brother is so low profile that no one knows he is a rich-two-generatio...
分类:
其他好文 时间:
2015-07-14 13:38:51
阅读次数:
150
题目:Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to thedefinition of LCA on Wikipedi...
分类:
其他好文 时间:
2015-07-14 13:23:34
阅读次数:
107
Problem DescriptionGiven a string, find the length of the longest substring T that contains at most 2 distinct characters.For example, Given s =“eceba...
分类:
其他好文 时间:
2015-07-14 13:20:40
阅读次数:
95
今天尝试用 Cocoapods安装个第三方库.. 输入pod install, 发现 command not find。 WTF!
估计是升级10.11后Cocoapods被干掉了。
我输入 sudo gem install cocoa pods 之后,出现如下问题:
ERROR: While executing gem ... (Gem::DependencyEr...
分类:
其他好文 时间:
2015-07-14 11:48:21
阅读次数:
467
直接删除文件find /tomcat/logs/ -name '*.log.*' | xargs rm -f2,将文件内容清零find /tomcat/logs/ -name 'catalina.out' | xargs truncate -s...
分类:
系统相关 时间:
2015-07-14 11:22:13
阅读次数:
168
题目Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between t...
分类:
其他好文 时间:
2015-07-14 10:09:09
阅读次数:
219
Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one unique longes...
分类:
其他好文 时间:
2015-07-14 09:48:50
阅读次数:
130
Question:Given an array of sizen, find the majority element. The majority element is the element that appears more than? n/2 ?times.You may assume tha...
分类:
其他好文 时间:
2015-07-14 07:32:48
阅读次数:
101