链接:https://leetcode-cn.com/problems/path-sum/ 代码 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeNode ...
分类:
其他好文 时间:
2020-07-26 19:00:19
阅读次数:
52
一、linux内核模块1.数据类型:char(8bits)、short int (16bits)、int(32bits)、long int(与CPU的字长一致) 2、内核模块的作用linux kernel Module >设备驱动是以独立的module的形式存在的,设计的驱动需要包含在module内 ...
分类:
其他好文 时间:
2020-07-26 15:53:48
阅读次数:
72
单例 A single-element enum type is often the best way to implement a singleton. 单元素的枚举类型已经成为实现Singleton的最佳方法。 一般有两种方式,对于比较简单的效果实现,可以直接在枚举里写方法。 public en ...
分类:
其他好文 时间:
2020-07-26 15:34:09
阅读次数:
55
题目:传送门 方法一、递归 中序遍历:先遍历左子树,在遍历根节点,最后遍历右子树。比较经典的方法是递归。 /** * Definition for a binary tree node. * struct TreeNode { * int val; * TreeNode *left; * TreeN ...
分类:
其他好文 时间:
2020-07-26 15:32:51
阅读次数:
67
<script type="text/javascript"> // 定了一个类 class Person{ // 定义一个构造方法 constructor(name,age){ console.log('父类构造方法') this.name=name; this.age=age; } // 定义普 ...
分类:
其他好文 时间:
2020-07-26 15:14:02
阅读次数:
50
#include <stdio.h> #include <graphics.h> #include <stdlib.h> #include <dos.h> /*引用的库函数*/ #define LEFT 0x4b00 #define RIGHT 0x4d00 #define DOWN 0x5000 ...
分类:
编程语言 时间:
2020-07-26 02:05:25
阅读次数:
127
考察二叉树的遍历。判断前序遍历,与新增的前->右->左遍历结果是否一致。 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 ListNode{ int val; struct ListNode* ne ...
分类:
编程语言 时间:
2020-07-26 01:33:46
阅读次数:
65
struct bign { int len, s[numlen]; bign() { memset(s, 0, sizeof(s)); len = 1; } bign(int num) { *this = num; } bign(const char *num) { *this = num; } b ...
分类:
其他好文 时间:
2020-07-26 01:31:46
阅读次数:
58
题目大意 题目: 大致题意: 给定n个左闭右开的区间,选出尽量多的区间使得这些区间两两不交,求最多能选多少个。 思路解析 按照区间右端点升序排序,依次枚举各个区间,若与上一个被选区间无交集,那么就将这个区间选中。 为什么要用右端点升序呢?因为这样子的话留给后面时间就多了。 程序注释 #include ...
分类:
其他好文 时间:
2020-07-26 01:23:28
阅读次数:
55