C and C++ allow various types of operators. By now, you should be familiar with the basic binary operators +, -, *, / and the boolean operators <, >, ...
分类:
其他好文 时间:
2020-05-19 12:14:52
阅读次数:
62
题目: 二叉树的最大深度:给定一个二叉树,找出其最大深度。 二叉树的深度为根节点到最远叶子节点的最长路径上的节点数。 说明: 叶子节点是指没有子节点的节点。 思路: 借助层序遍历来做,有多少层树就有多深。 程序: # Definition for a binary tree node. # clas ...
分类:
编程语言 时间:
2020-05-19 11:06:30
阅读次数:
164
pip3 install python3-ldap 报错 首先你要先安装python3-devel和gcc 再次执行 pip3 install python3-ldap 就能安装成功 ...
分类:
编程语言 时间:
2020-05-19 11:00:48
阅读次数:
106
算法分析 主定律: Master Theorem 常用算法的时间复杂度 Algorithm Recurrence relationship Run time Binary Search T(n) = T(n/2) + O(1) O(logn) Binary Tree traversal T(n) = ...
分类:
编程语言 时间:
2020-05-19 10:33:19
阅读次数:
58
题目: 相同的树:给定两个二叉树,编写一个函数来检验它们是否相同。 如果两个树在结构上相同,并且节点具有相同的值,则认为它们是相同的。 思路: 递归秒解,思路也简单。 程序: # Definition for a binary tree node. # class TreeNode: # def _ ...
分类:
编程语言 时间:
2020-05-18 21:01:41
阅读次数:
86
编译安装python3.6的步骤 1.下载python3源码包 wget https://www.python.org/ftp/python/3.6.6/Python 3.6.6.tgz 2.下载python3编译的依赖包 yum install y gcc patch libffi devel p ...
分类:
编程语言 时间:
2020-05-18 20:22:45
阅读次数:
87
Makefile 使用小结 https://www.cnblogs.com/yongdaimi/p/8109509.html Makefile的基本格式 #目标:依赖(条件) # 命令 #all: add.c sub.c dive.c mul.c main.c # gcc add.c sub.c d ...
分类:
其他好文 时间:
2020-05-18 15:54:30
阅读次数:
83
此博客链接:https://www.cnblogs.com/ping2yingshi/p/12907812.html 二叉树的最大深度(59min) 题目链接:https://leetcode-cn.com/problems/maximum-depth-of-binary-tree/ 给定一个二叉树 ...
分类:
其他好文 时间:
2020-05-18 01:09:22
阅读次数:
126
以下内容来自lttng 官方文档,主要是学习记录 创建tracepoint hello-tp.h #undef TRACEPOINT_PROVIDER #define TRACEPOINT_PROVIDER hello_world ? #undef TRACEPOINT_INCLUDE #defin ...
分类:
编程语言 时间:
2020-05-17 17:58:11
阅读次数:
180
题目: 二叉搜索树迭代器:实现一个二叉搜索树迭代器。你将使用二叉搜索树的根节点初始化迭代器。 调用 next() 将返回二叉搜索树中的下一个最小的数。 思路: 二叉搜索树使用中序,然后弹出栈底。 程序: # Definition for a binary tree node. # class Tre ...
分类:
编程语言 时间:
2020-05-16 10:55:17
阅读次数:
70