随笔 - 545  文章 - 0  评论 - 31  阅读 - 72万 
05 2018 档案
死锁 必然
摘要:问题: 写一个“必然”会出现死锁的一段代码,我面过很多人,他们写的都不是严格意义上的死锁,都被我挑出来很多刺。 一: 多线程的话可以用信号量 1 锁 A,2 锁 B 1 给 2 发信号,2 给 1 发信号 等到收到信号,1 锁 B,2 锁 A (这里,要等到对方同意才可以锁。比如:1现在锁A,通过信 阅读全文
posted @ 2018-05-24 11:57 反光的小鱼儿 阅读(116) 评论(0) 推荐(0) 编辑
two-sum
摘要:描述 Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the tw 阅读全文
posted @ 2018-05-08 15:35 反光的小鱼儿 阅读(137) 评论(0) 推荐(0) 编辑

点击右上角即可分享
微信分享提示