要求 对二叉树进行层序遍历 实现 1 Definition for a binary tree node. 2 struct TreeNode { 3 int val; 4 TreeNode *left; 5 TreeNode *right; 6 TreeNode(int x) : val(x), ...
分类:
其他好文 时间:
2020-04-07 09:36:40
阅读次数:
53
链接:https://leetcode cn.com/problems/binary tree zigzag level order traversal/ ...
分类:
其他好文 时间:
2020-04-06 20:53:54
阅读次数:
53
链接:https://leetcode cn.com/problems/maximum depth of binary tree/ 递归 ...
分类:
其他好文 时间:
2020-04-06 20:24:13
阅读次数:
74
定义 trim 去除字符串里的空白符及其他指定字符 Strip whitespace (or other characters) from the beginning and end of a string 描述 参数 可指定任意字符,使用..可指定一个范围 默认去除下面五个字符 " " (ASCI ...
分类:
Web程序 时间:
2020-04-06 19:02:08
阅读次数:
93
1 // 2 // Stack.h 3 // 顺序栈 4 // 5 // Created by geshenglu on 2020/3/21. 6 // Copyright © 2020 geshenglu. All rights reserved. 7 // 8 9 #ifndef Stack_h ...
分类:
其他好文 时间:
2020-04-06 15:42:55
阅读次数:
83
Given the node of a binary search tree, return the sum of values of all nodes with value between and (inclusive). The binary search tree is guaranteed ...
分类:
其他好文 时间:
2020-04-06 09:50:46
阅读次数:
73
1 class Solution: 2 def hIndex(self, citations): 3 citations_len = len(citations) 4 if citations_len<=0: 5 return 0 6 low = 0 7 high = citations_len-1 ...
分类:
其他好文 时间:
2020-04-06 09:24:25
阅读次数:
69
An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with the ...
分类:
其他好文 时间:
2020-04-06 00:21:55
阅读次数:
65
链接:https://leetcode cn.com/problems/binary tree level order traversal/ ...
分类:
其他好文 时间:
2020-04-05 22:26:38
阅读次数:
69
1、准备数据 import numpy as np import pandas as pd import matplotlib.pyplot as plt import tensorflow as tf from tensorflow.keras import models,layers dftra ...
分类:
其他好文 时间:
2020-04-05 18:16:13
阅读次数:
337