↧
微软笔试题《Colorful Lecture Note》
#1103 : Colorful Lecture Note 时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi is writing an algorithm lecture note for Little Ho. To make the note more comprehensible, Little Hi tries to color some...
View Article微软笔试题《Spring Outing》
题目1 : Spring Outing 时间限制:20000ms 单点时限:1000ms 内存限制:256MB 描述 You class are planning for a spring outing. N people are voting for a destination out of K candidate places. The voting progress is below:...
View ArticleFloyd判圈算法
一、链表判环 如何判断一个简单的单向链表是否有环,我们只需要维护两个指针pSlow,pFast,一开始初始化为链表头指针,pSlow每步前进一个节点,pFast每步前进两个节点。如果链表有环,则pSlow和pFast肯定会相遇。 二、求环的起点与环长...
View ArticleScramble String
Scramble String Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively. Below is one possible representation of s1 = "great":great / \ gr eat...
View Article