摘要:
Given an unsorted integer array, find the first missing positive integer. For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2. Your algorithm s 阅读全文
摘要:
Given a set of candidate numbers (C) and a target number (T), find all unique combinations in C where the candidate numbers sums to T. The same repeat 阅读全文
摘要:
1.虚函数 如果不使用virtual关键字,当使用基类的指针p指向派生类的对象是,调用的p的一个方法(比如print)时,调用的是基类里面的print方法。 如果使用virtual关键字,则可以调用派生类里的print方法。 class Base { public:Base(){} public: 阅读全文
摘要:
Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm's runtime complexity must be in the or 阅读全文
摘要:
Given a string containing just the characters'('and')', find the length of the longest valid (well-formed) parentheses substring.For"(()", the longest... 阅读全文