仅供自己学习 思路: 按照题目要求我们需要定义一个head头节点,并且因为树是二叉搜索树,所以要采取中序遍历才能得到从小到大的排序。 按照中序遍历的模板 dfs(root->left); cout<<root->val; dfs(root->right); 同样我们也通过这个模板写DFS,这里因为是 ...
分类:
其他好文 时间:
2021-04-05 12:33:29
阅读次数:
0
摘自:https://blog.csdn.net/weibo1230123/article/details/81410241 前言:1.linux线程执行和windows不同,pthread有两种状态joinable状态和unjoinable状态,如果线程是joinable状态,当线程函数自己返回退 ...
分类:
系统相关 时间:
2021-04-05 11:58:12
阅读次数:
0
一、查询执行最慢的sql select * from (select sa.SQL_TEXT, sa.SQL_FULLTEXT, sa.EXECUTIONS "执行次数", round(sa.ELAPSED_TIME / 1000000, 2) "总执行时间", round(sa.ELAPSED_T ...
分类:
数据库 时间:
2021-04-02 13:30:19
阅读次数:
0
问题: 给定一个数组,求任意区间[left, right]的元素和。 Example 1: Input ["NumArray", "sumRange", "sumRange", "sumRange"] [[[-2, 0, 3, -5, 2, -1]], [0, 2], [2, 5], [0, 5]] ...
分类:
其他好文 时间:
2021-04-01 12:58:58
阅读次数:
0
/* // Definition for a Node. class Node { public: int val; Node* left; Node* right; Node* next; Node() : val(0), left(NULL), right(NULL), next(NULL) { ...
分类:
其他好文 时间:
2021-03-31 12:27:25
阅读次数:
0
var arr = [1,2,3,4,5,6] console.log(Math.max.apply(null,arr.join(',').split(','))) //6 console.log(Math.min.apply(null,arr.join(',').split(','))) //1 ...
分类:
编程语言 时间:
2021-03-30 13:48:22
阅读次数:
0
1 <!DOCTYPE html> 2 <html> 3 <head> 4 <meta charset="utf-8" /> 5 <title></title> 6 <style type="text/css"> 7 8 .list1 { 9 float:left; 10 list-style: n ...
分类:
Web程序 时间:
2021-03-30 13:45:09
阅读次数:
0
# Definition for a binary tree node. # class TreeNode: # def __init__(self, x): # self.val = x # self.left = None # self.right = None # 递归 # 时间复杂度:O(n ...
分类:
其他好文 时间:
2021-03-29 12:51:26
阅读次数:
0
内部类的基本使用 内部类概念 在一个类中定义一个类。举例:在一个类A的内部定义一个类B,类B就被称为内部类 内部类定义格式 格式&举例: /* 格式: class 外部类名{ 修饰符 class 内部类名{ } } */ class Outer { public class Inner { } } ...
分类:
编程语言 时间:
2021-03-29 12:39:53
阅读次数:
0
先看看多少代码量 import os file_types = ['py', 'html', 'css', 'js', ] def count_code_nums(file): """获取单个文件的行数 """ with open(file, mode='rb') as f: return len( ...
分类:
其他好文 时间:
2021-03-29 12:13:33
阅读次数:
0