摘要: 多线程库总结 基于线程的并行性 threading模块 下面是一些基础函数,函数包括: threading模块一共提供的类包括:local、Thread、Lock、RLock、Condition、Semaphore、Event、Time 1. Thead-Local Data 专门用来管理线程局部的 阅读全文
posted @ 2017-09-12 22:43 banananana 阅读(2879) 评论(0) 推荐(1) 编辑
摘要: 454. 4Sum II 题意:从给定的数组中统计四个数相加和为0的个数 思路:用哈希表来保存,四个数分成两部分,统计双方和的个数,最后相加。 import collections class Solution(object): def fourSumCount(self, A, B, C, D): 阅读全文
posted @ 2017-09-12 09:40 banananana 阅读(122) 评论(0) 推荐(0) 编辑