www

导航

上一页 1 ··· 5 6 7 8 9

2017年9月21日 #

二叉树和为某一值的路径

摘要: struct TreeNode { TreeNode *left; TreeNode *right; int val; }; void helper(TreeNode *root, vector &path, int currentsum, int sum) { path.push_back(root->val); currentsum += root-... 阅读全文

posted @ 2017-09-21 21:09 www_practice 阅读(133) 评论(0) 推荐(0) 编辑

2017年9月19日 #

单链表反转

摘要: 1 ListNode* Reverse(ListNode *head) 2 { 3 if (head == nullptr || head->next == nullptr) 4 return head; 5 6 ListNode *p = head, *q = head->next; 7 p->next = nullptr; 8 ... 阅读全文

posted @ 2017-09-19 09:51 www_practice 阅读(119) 评论(0) 推荐(0) 编辑

2017年9月18日 #

二叉树遍历(中序)

摘要: void PreOrder(TreeNode *root) { TreeNode *p = root; stack s; while (!s.empty() || p) { while (p) { s.push(p); p = p->left; } if (!s.empty()) { p = s.top(); s.pop(); cout... 阅读全文

posted @ 2017-09-18 16:35 www_practice 阅读(96) 评论(0) 推荐(0) 编辑

二叉树遍历(前序)

摘要: void PreOrder(TreeNode *root) { TreeNode *p = root; stack s; while (!s.empty() || p) { while (p) { cout val left; } if (!s.empty()) { p = s.top(); s.pop(); p = p->right; ... 阅读全文

posted @ 2017-09-18 16:17 www_practice 阅读(154) 评论(0) 推荐(0) 编辑

QuickSort

摘要: int Partition(vector &input, int start, int end) { int index=start; for(int i=start+1; i &input, int start, int end) { if(start>=end) return; int index=Partition(i... 阅读全文

posted @ 2017-09-18 16:03 www_practice 阅读(111) 评论(0) 推荐(0) 编辑

HTTP状态码

摘要: HTTP状态码 当浏览者访问一个网页时,浏览者的浏览器会向网页所在服务器发出请求。当浏览器接收并显示网页前,此网页所在的服务器会返回一个包含HTTP状态码的信息头(server header)用以响应浏览器的请求。 HTTP状态码的英文为HTTP Status Code。 下面是常见的HTTP状态码 阅读全文

posted @ 2017-09-18 15:25 www_practice 阅读(122) 评论(0) 推荐(0) 编辑

上一页 1 ··· 5 6 7 8 9