上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页
摘要: ```C++ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; ... 阅读全文
posted @ 2018-08-01 18:15 一条图图犬 阅读(266) 评论(0) 推荐(0) 编辑
摘要: ```C++ /* // Definition for a Node. class Node { public: int val; vector children; Node() {} Node(int _val, vector _children) { val = _val; children = _children; ... 阅读全文
posted @ 2018-07-30 16:45 一条图图犬 阅读(478) 评论(0) 推荐(0) 编辑
摘要: ```C++ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; ... 阅读全文
posted @ 2018-07-30 00:00 一条图图犬 阅读(347) 评论(0) 推荐(0) 编辑
摘要: ```python3 # Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None from collections import d... 阅读全文
posted @ 2018-07-29 23:45 一条图图犬 阅读(443) 评论(0) 推荐(0) 编辑
摘要: ```C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: int ... 阅读全文
posted @ 2018-07-28 22:18 一条图图犬 阅读(356) 评论(0) 推荐(0) 编辑
摘要: 两种思路,第一种就是在数组两边放置两个指针,第二种是在数组左边放置两个快慢指针。第二种方法更简洁,并且可以扩展至单链表的情形。推荐使用 C++ include include include include include include include include include using 阅读全文
posted @ 2018-07-28 22:05 一条图图犬 阅读(2124) 评论(0) 推荐(0) 编辑
摘要: ```C++ /** * Definition for singly-linked list. * struct ListNode { * int val; * ListNode *next; * ListNode(int x) : val(x), next(NULL) {} * }; */ class Solution { public: int ... 阅读全文
posted @ 2018-07-28 12:21 一条图图犬 阅读(442) 评论(0) 推荐(0) 编辑
摘要: ```python3 """ # Definition for a Node. class Node(object): def __init__(self, val, children): self.val = val self.children = children """ class Solution(object): def maxDepth(... 阅读全文
posted @ 2018-07-28 00:36 一条图图犬 阅读(554) 评论(0) 推荐(0) 编辑
摘要: ```C++ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; ... 阅读全文
posted @ 2018-07-27 23:22 一条图图犬 阅读(189) 评论(0) 推荐(0) 编辑
摘要: ```C++ /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(NULL), right(NULL) {} * }; ... 阅读全文
posted @ 2018-07-27 23:06 一条图图犬 阅读(359) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 21 下一页