``` //单点修改 pushup //查询区间内的最大字段和 #include #include #include #include using namespace std; const int N = 500010; int n, m; int w[N]; struct Node { //端点 ... ...
分类:
其他好文 时间:
2020-05-06 20:03:08
阅读次数:
53
// 选中父节点时,选中所有子节点 function getChildNodeIdArr(node) { var ts = []; if (node.nodes) { for (x in node.nodes) { ts.push(node.nodes[x].nodeId); if (node.no ...
分类:
其他好文 时间:
2020-05-06 14:03:28
阅读次数:
80
题目: 解答: 1 先将数每一位拆成数组2,若数组为非升序序列,则直接返回原数即可3,否则,就找到数组中第一次出现升序的位置,从该位置往后找到最后一个最大值max_val及其下标max_ind4,从数组头开始找第一个比max_val小的数的下标i,交换i与max_ind位置的数即可 1 class ...
分类:
编程语言 时间:
2020-05-05 18:26:37
阅读次数:
60
C++ Stack(堆栈) 是一个容器类的改编,为程序员提供了堆栈的全部功能,——也就是说实现了一个先进后出(FILO)的数据结构。 c++ stl栈stack的头文件为: #include <stack> c++ stl栈stack的成员函数介绍 empty() 堆栈为空则返回真 pop() 移除 ...
分类:
其他好文 时间:
2020-05-05 18:05:38
阅读次数:
69
(一)一般分区 /boot 引导分区 256M swap 交换分区 物理内存的1.5倍左右,最高8G / 根分区 剩余都给 适用于:数据不太重要的服务器 (二)存储服务器(含数据库) /boot 引导分区 256M swap 交换分区 物理内存的1.5倍左右,最高8G / 根分区 100G /dat ...
分类:
系统相关 时间:
2020-05-05 09:15:52
阅读次数:
81
文件管理概述 对于Linux系统的目录结构,没有必要去背。我们要记住的就只是有几个常用的目录。 文件目录是以根目录为顶点开始的,Linux系统文件的目录结构: 对于linux中文件的基本操作: 1. 创建 mkdir文件夹,touch文件 2. 删除 rmdir文件夹 3. 编辑 4. 查看 tre ...
分类:
系统相关 时间:
2020-05-04 21:27:11
阅读次数:
103
Given a complete binary tree, count the number of nodes. Note: Definition of a complete binary tree from Wikipedia: In a complete binary tree every le ...
分类:
其他好文 时间:
2020-05-04 15:47:22
阅读次数:
55
问题: 求给定数组中两两元素之差,从小到大第k个差是多少 Example 1: Input: nums = [1,3,1] k = 1 Output: 0 Explanation: Here are all the pairs: (1,3) -> 2 (1,1) -> 0 (3,1) -> 2 Th ...
分类:
其他好文 时间:
2020-05-04 15:42:43
阅读次数:
48
#include "stdio.h"#include "stdbool.h"void swap(int *t1, int *t2){ int temp; temp = *t1; *t1 = *t2; *t2 = temp;}void bubble_sort(int arr[], int len){ ...
分类:
编程语言 时间:
2020-05-04 15:28:55
阅读次数:
55
1. List 容器的基本概念 1. list 是一个双向链表容器,可高效的进行插入删除元素,他的原理在于每个元素都有两个指针来记录前后两个元素的地址,像火车车厢一样,list 中各个元素在物理存储单元上非连续,是通过指针相连在一起的。 2. 相较于vector的连续线性空间,list会显得复杂许多 ...
分类:
其他好文 时间:
2020-05-04 00:52:48
阅读次数:
52