摘要:
Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5->NULL.No... 阅读全文
摘要:
You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality c... 阅读全文
摘要:
首先考虑的是一个很典型的关系,就是矩形与正方形的关系: 1 class Recantagle{ 2 virtual void setHeight(int); 3 virtual void setWidth(int); 4 virtual int height(int)cons... 阅读全文
摘要:
inline可以带来各种好处:首先其可以使得消除函数调用带来的开销,再者编译器对这种非函数的代码可以做出更多的优化策略。但是inline函数首先肯定是会导致程序代码的大小更加的庞大,这样会带来代码膨胀,造成的损害首先就是会导致计算机额外的换页行为,降低指令告诉缓存的集中率,这要就会带来效率上的损失。... 阅读全文
摘要:
首先看看下面这个例子: 1 class Point{ 2 public: 3 point(int x, int y); 4 ... 5 void setX(int newVal); 6 void setY(int newVal); 7 ... 8 }; 9 s... 阅读全文
摘要:
Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".简单的二进制相加而已,只不过传入的参数是字符串而已。为了方便,先将string reverse... 阅读全文
摘要:
Given a non-negative number represented as an array of digits, plus one to the number.The digits are stored such that the most significant digit is at... 阅读全文
摘要:
Given two numbers represented as strings, return multiplication of the numbers as a string.Note: The numbers can be arbitrarily large and are non-nega... 阅读全文
摘要:
You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single ... 阅读全文
摘要:
在leetCode上做的第一个难度是hard的题,题目如下:Given an unsorted integer array, find the first missing positive integer.For example,Given[1,2,0]return3,and[3,4,-1,1]re... 阅读全文