= =买了书才能做的题。。。就是按说明来搞就行了,没啥算法。。。注意要把以前的left,right设置为nullptr,不然就是有环了,代码中加黑部分。/** * Definition for binary tree * struct TreeNode { * int val; * ...
分类:
其他好文 时间:
2014-11-19 18:19:19
阅读次数:
168
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), ne...
分类:
其他好文 时间:
2014-11-19 13:51:14
阅读次数:
222
题目https://oj.leetcode.com/problems/populating-next-right-pointers-in-each-node/对每个节点递归。 1 /** 2 * Definition for binary tree with next pointer. 3 * .....
分类:
其他好文 时间:
2014-11-19 12:13:56
阅读次数:
154
Sort a linked list using insertion sort.Solution: 1 /** 2 * Definition for singly-linked list. 3 * public class ListNode { 4 * int val; 5 * ...
分类:
其他好文 时间:
2014-11-17 09:11:05
阅读次数:
218
Mergeksorted linked lists and return it as one sorted list. Analyze and describe its complexity.Solution 1:PriorityQueue: 1 /** 2 * Definition for si....
分类:
其他好文 时间:
2014-11-17 08:04:09
阅读次数:
176
1.when we wanna share const variables;we use the keywordexternon both its definition and declaration(s):2.Once initialized, a reference remains bound ...
分类:
编程语言 时间:
2014-11-16 21:24:45
阅读次数:
225
Sort a linked list using insertion sort.C++代码如下:#include#includeusing namespace std;//Definition for singly-linked list.struct ListNode{ int val; ...
分类:
其他好文 时间:
2014-11-15 21:34:17
阅读次数:
297
1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 * ListNode *next; 6 * ListNode(int x) : val(x), ne...
分类:
其他好文 时间:
2014-11-15 00:03:01
阅读次数:
364
#!/bin/bash#################################################thisscriptsiscreatedbyzhangyj#zhangyjQQ:791880666#mobilephone:13716430471#thanksforoldboyteacher#Function:TheScriptsformysql-slave####################################################reloadfunctions..
分类:
其他好文 时间:
2014-11-14 01:43:40
阅读次数:
327
/**
* Definition for binary tree
* public class TreeNode {
* int val;
* TreeNode left;
* TreeNode right;
* TreeNode(int x) { val = x; }
* }
*/
public class Solution {
publi...
分类:
其他好文 时间:
2014-11-12 13:49:37
阅读次数:
169