摘要:
二叉树中的那些常见的面试题 阅读全文
摘要:
#include #include #include //#include using namespace std;using namespace __gnu_cxx;//define the classclass ClassA{ public: Clas... 阅读全文
摘要:
实现一个函数,对一个正整数n,算得到1需要的最少操作次数:如果n为偶数,将其除以2;如果n为奇数,可以加1或减1;一直处理下去。例子:ret=func(7);ret=4,可以证明最少需要4次运算n=7n--6n/2 3n/2 2n++1要求:实现函数(实现尽可能高效)int func(unsign ... 阅读全文