考察二叉树的遍历。判断前序遍历,与新增的前->右->左遍历结果是否一致。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义二叉树 struct TreeNode{ int val; struct Tree ...
分类:
其他好文 时间:
2020-07-26 01:57:55
阅读次数:
63
考察二叉树的遍历。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义二叉树 struct TreeNode{ int val; struct TreeNode* left; struct TreeNode ...
分类:
其他好文 时间:
2020-07-26 01:18:59
阅读次数:
54
Creating a GUI the way we just did works okay for very small scripts, but a much more scalable approach is to subclass Tkinter widgets to create compo ...
分类:
其他好文 时间:
2020-07-26 00:40:59
阅读次数:
61
//引入命名空间 xmlns:th="http://www.thymeleaf.org" //用th:<prop>替换<prop>属性的值 <h4 th:text="${hello}" ></h4> 1 Fragment inclusion th:insert th:replace 2 Fragme ...
分类:
其他好文 时间:
2020-07-26 00:03:15
阅读次数:
114
一 内置方法的工作原理 1 当你看到像 mystuff.append('hello') 这样的代码时,你事实上已经在 Python 内部激发了一个连锁反应。以下是它的工作原理: Python 看到你用到了 mystuff ,于是就去找到这个变量。也许它需要倒着检查看你有没有在哪里用 = 创建过这个变 ...
分类:
其他好文 时间:
2020-07-24 15:38:33
阅读次数:
73
在Flask中,添加路由有两种方式:(一般情况下都是用第一种方式) 第一种:常见的装饰器模式 @app.route("/") def index(): return "Hello World" 通过这种方式,将rule与视图函数对应起来 第二种:通过阅读装饰器模式添加路由的源码发现 def rout ...
分类:
其他好文 时间:
2020-07-23 23:29:38
阅读次数:
138
function* bar() { const result = yield new Promise((resolve, reject) => { setTimeout(() => { resolve('Hello Generator'); }, 3000); }); console.log(res ...
分类:
其他好文 时间:
2020-07-23 23:26:40
阅读次数:
118
1. 运行python代码。 在d盘下创建一个t1.py文件内容是: print('hello world') 打开windows命令行输入cmd,确定后 写入代码python d:t1.py 您已经运行了第一个python程序, 即:终端 >cmd > python 文件路径。 回车搞定~ 2. ...
分类:
编程语言 时间:
2020-07-23 23:16:53
阅读次数:
102
本文看自视频: 1.打印文件系统看看 运行可以自动创建一个hello.txt文件 内容写入 如果想要定义写入的位置,我们可以用另外的api 异步文件的读取,没有获取到的时候可以打印错误码 简单文件写入的顺序 简单文件写入文件写在路径下,运行可以在对应的路径下写入文件 流式文件写入 简单文件的读取,返 ...
分类:
Web程序 时间:
2020-07-23 23:11:57
阅读次数:
103
今天我们学习内容为 “class与style绑定”。 最直观的class与style的绑定在之前的插值 v-bind 的时候就有提到过,为了加深印象,我们在把最基础的用法拿出来看一下。 <div id="app" :class="{active:isActive}" style="width: 20 ...
分类:
其他好文 时间:
2020-07-23 22:25:58
阅读次数:
84