摘要:
Given a linked list, return the node where the cycle begins. If there is no cycle, returnnull.Follow up:Can you solve it without using extra space?转自:http://www.cnblogs.com/x1957/p/3406448.html比I麻烦点的就是找到循环开始点TATI只是判断是否循环。要求不使用额外空间(不然hash就可以了按I的思路,我们又慢指针S和快指针F。。。F走两步,S走一步。。。若有环,必定相遇。画个图(很丑勿喷假设在红色凸起的地 阅读全文
摘要:
Givennpairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, givenn= 3, a solution set is:"((()))", "(()())", "(())()", "()(())", "()()()"递归与深搜。 1 class Solution { 2 public: 3 void getRes(vector &a 阅读全文