1、Processes and Threads In concurrent programming, there are two basic units of execution: processes and threads.(并发程序中,有2个基本的执行单位:进程、线程) 1.1、Processe ...
分类:
编程语言 时间:
2020-11-12 13:23:54
阅读次数:
6
先看两个例子,比较不同: 例一(有回调函数) #include <iostream> using namespace std; void foo_one() { cout<<"foo_one"<<endl; } void foo_two() { cout<<"foo_two"<<endl; } ty ...
分类:
其他好文 时间:
2020-11-11 16:29:50
阅读次数:
8
#1:在数组中找两个数,使其和为target 链接:https://leetcode-cn.com/problems/two-sum/ 暴力就是n^2,可以用map来做,这里介绍一下map.count(tmp)函数,是搜索key的值,map里存在值为tmp的key就返回1,否则是0 #122:给定一 ...
分类:
其他好文 时间:
2020-11-08 17:59:16
阅读次数:
25
# 作用就是:将可迭代对象中的元素和索引同时取出 seq = ['one', 'two', 'three'] for i, element in enumerate(seq): print('index:element {}: {}'.format(i, element)) print('\n') ...
分类:
编程语言 时间:
2020-11-08 16:38:34
阅读次数:
16
Leetcode(easy Double pointer) Leetcode 双指针简单题目 26 删除排序数组中的重复项 class Solution{ public int removeDuplicates(int[] nums){ // step代表慢指针 int step = 0; // 这 ...
分类:
其他好文 时间:
2020-11-06 02:28:21
阅读次数:
24
原文链接:https://without.boats/blog/two-memory-bugs-from-ringbahn/ 原文标题:Two Memory Bugs From Ringbahn 公众号:Rust 碎碎念 翻译: Praying 在实现ringbahn[1]的时候,我引入了至少两个 ...
分类:
其他好文 时间:
2020-11-04 17:55:28
阅读次数:
13
两根指针,英文为two pointers ,所以又被称为双P算法。 同向双指针问题 1.window sum问题 例给定数组[1, 2, 7, 8, 5],给定一个长度为k的窗口,求此窗口内的数据元素的和。比如1 + 2 + 7 = 10, 2 + 7 + 8 = 17, 7 + 8 + 5 = 2 ...
分类:
其他好文 时间:
2020-11-02 09:54:07
阅读次数:
33
题目 题目链接:https://codeforces.com/problemset/problem/468/B 给出 \(n\) 个各不相同的数字,将它们分别放入 \(A\) 和 \(B\) 两个集合中,使它们满足: 若数字 \(x\) 在集合 \(A\) 中,那么数字 \(a-x\) 也在集合 \ ...
分类:
其他好文 时间:
2020-10-30 12:08:18
阅读次数:
14
本文来自作者 "臣不贰" 投稿。 CSDN:https://blog.csdn.net/NOT_TWO_CHEN/article/details/109230267 简书:https://www.jianshu.com/p/a24a9ff323c9 一. 开发准备 1. 开发工具 IntelliJ ...
分类:
编程语言 时间:
2020-10-29 09:54:54
阅读次数:
23
图文详解 Intellij IDEA配置Jetty 新鲜的桔子 2018-05-22 15:20:02 16351 收藏 5 分类专栏: Spring MVC Jetty 文章标签: Spring MVC Jetty 版权 图文详解 Intellij IDEA配置Jetty 新鲜的桔子 2018-0 ...
分类:
其他好文 时间:
2020-10-29 09:32:26
阅读次数:
14