Ashish has a tree consisting of nn nodes numbered 11 to nn rooted at node 11 . The ii -th node in the tree has a cost aiai , and binary digit bibi is ...
分类:
其他好文 时间:
2020-06-01 23:55:59
阅读次数:
100
Introduction celery beat is a scheduler; It kicks off tasks at regular intervals, that are then executed by available worker nodes in the cluster. By ...
分类:
其他好文 时间:
2020-06-01 22:16:16
阅读次数:
117
1 #include<iostream> 2 #include<time.h> 3 #include<stdlib.h> 4 #include<sys/timeb.h> 5 using namespace std; 6 7 const int Max = 9999; 8 9 void swap(in ...
分类:
编程语言 时间:
2020-06-01 20:36:38
阅读次数:
63
前一段时间,我们机房中一台Linux服务器运行缓慢,系统服务出现间歇性停止响应,让我过去处理一下这一问题,登录到服务器之后,发现此服务器的物理内存是16G,而最初装机的时候,系统管理人员却只分配了4G的虚拟内存。查看内存的使用状况,物理内存并没有完全耗尽,但虚拟内存已经耗尽,整个系统CPU负载和磁盘 ...
分类:
系统相关 时间:
2020-05-31 21:26:53
阅读次数:
104
冒泡排序是一种简单的排序算法。 1 #pragma once 2 #include <iostream> 3 #include <assert.h> 4 using std::cout; 5 using std::endl; 6 template <typename T> void Swap(T & ...
分类:
编程语言 时间:
2020-05-31 19:51:05
阅读次数:
66
CAS和AtomicInteger AtomicInteger用来保证自增原子性,它的实现是基于CAS(比较和交换)的。 CAS(CompareAndSwap):判断内存某个位置的值是否与预期值一致,如果是则更改为新值,这个过程是原子的。不会造成数据不一致的问题。 compareAndSet(exc ...
分类:
其他好文 时间:
2020-05-31 16:17:58
阅读次数:
81
Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l ...
分类:
其他好文 时间:
2020-05-31 00:45:36
阅读次数:
52
原子CAS操作 原子操作指令里,有原子加,原子减,cas到底是什么呢? 首先看一段代码, bool compare_and_swap(int *accum, int *dest, int newval) { if (*accum == *dest) { *dest = newval; return ...
分类:
其他好文 时间:
2020-05-29 23:38:08
阅读次数:
104
双指针反转 class Solution { public: void reverseString(vector<char>& s) { int start = 0; int end = s.size() - 1; while (start < end) { swap(s[start], s[end ...
分类:
其他好文 时间:
2020-05-29 23:31:50
阅读次数:
107
1.图片不需要进行预处理 2. 预处理由以下2个参数决定的 找到的2个边如下红线所示 生成的程序如下: AmplitudeThreshold := 50 measure_pairs (Image, MsrHandle_Measure_01_0, 11.3, AmplitudeThreshold, ' ...
分类:
其他好文 时间:
2020-05-29 12:10:58
阅读次数:
87