码迷,mamicode.com
首页 >  
搜索关键字:definition    ( 2735个结果
[leetcode]Binary Tree Upside Down
= =买了书才能做的题。。。就是按说明来搞就行了,没啥算法。。。注意要把以前的left,right设置为nullptr,不然就是有环了,代码中加黑部分。/** * Definition for binary tree * struct TreeNode { * int val; * ...
分类:其他好文   时间:2014-11-19 18:19:19    阅读次数:168
LeetCode Remove Duplicates from Sorted List 删除有序链表中的重复结点
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
LeetCode - Populating Next Right Pointers in Each Node
题目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
[Leetcode] Insertion Sort List
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
[Leetcode] Merge k Sorted Lists
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
c++ primer learning point.1
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
Insertion Sort List
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
LeetCode Remove Nth Node From End of List 删除链表的倒数第n个结点
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
LeetCode Minimum Depth of Binary Tree
/** * 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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!