摘要:
void connect(TreeLinkNode *root) { // Note: The Solution object is instantiated only once and is reused by each test case. if(!root) return; TreeLinkNode* first,*cur; first = cur = root; while(cur) { if(cur->left) { ... 阅读全文
posted @ 2013-10-23 14:47
summer_zhou
阅读(169)
评论(0)
推荐(0)
摘要:
vector getRow(int rowIndex) { // Note: The Solution object is instantiated only once and is reused by each test case. if(rowIndex(); vector res(rowIndex+1); res[0] = 1; for(int i=1;i0;j--) res[j] += res[j-1]; res[0] = 1; ... 阅读全文
posted @ 2013-10-23 14:30
summer_zhou
阅读(134)
评论(0)
推荐(0)
摘要:
//注意容器的空间,如果没有预设好,[]访问会出错的。。。。---这个很容易出问题。 vector > generate(int numRows) { // Note: The Solution object is instantiated only once and is reused by each test case. vector> res; if(numRows()); res[0].push_back(1); for(int i=1;i<numRows;i++) { ... 阅读全文
posted @ 2013-10-23 11:50
summer_zhou
阅读(140)
评论(0)
推荐(0)
浙公网安备 33010602011771号