摘要: class Solution {public: ListNode *reverseKGroup(ListNode *head, int k) { if (k next = rhead; } last = rtail; } ... 阅读全文
posted @ 2014-07-27 23:18 卖程序的小歪 阅读(224) 评论(0) 推荐(0) 编辑
摘要: Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n.For example,Givenn= 3, your program should return all 5 uni... 阅读全文
posted @ 2014-07-27 21:59 卖程序的小歪 阅读(178) 评论(0) 推荐(0) 编辑
摘要: Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next level and ... 阅读全文
posted @ 2014-07-27 13:26 卖程序的小歪 阅读(161) 评论(0) 推荐(0) 编辑
摘要: struct mystat { int idx; int cnt[26]; mystat(int id = 0) {idx = id;}};bool cmp(const mystat &a, const mystat &b) { for (int i=0; i b.cnt[i... 阅读全文
posted @ 2014-07-27 12:42 卖程序的小歪 阅读(108) 评论(0) 推荐(0) 编辑