上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 46 下一页

2017年11月27日

java生产者,消费者

摘要: 有很多实现的方法 使用blockingqueue实现 demo 注意: 自定义容器实现生产者消费者 备注: 阅读全文

posted @ 2017-11-27 10:26 luckygxf 阅读(324) 评论(0) 推荐(0)

2017年11月26日

java lock

摘要: 多线程访问同一个变量,不进行同步,会造成结果不一致。这里解决方案有很多,使用原子变量。加锁同步,使用synchronized同步。下面是一个lock demo,后面会分析lock实现原理。lock使用的是公平锁还是非公平锁等 阅读全文

posted @ 2017-11-26 22:21 luckygxf 阅读(154) 评论(0) 推荐(0)

2017年10月29日

Trim a Binary Search Tree

摘要: Given a binary search tree and the lowest and highest boundaries as L and R, trim the tree so that all its elements lies in [L, R] (R >= L). You might 阅读全文

posted @ 2017-10-29 17:16 luckygxf 阅读(133) 评论(0) 推荐(0)

2017年10月28日

Baseball Game

摘要: You're now a baseball game point recorder. Given a list of strings, each string can be one of the 4 following types: Each round's operation is permane 阅读全文

posted @ 2017-10-28 17:21 luckygxf 阅读(192) 评论(0) 推荐(0)

Reverse Words in a String III

摘要: Given a string, you need to reverse the order of characters in each word within a sentence while still preserving whitespace and initial word order. E 阅读全文

posted @ 2017-10-28 16:37 luckygxf 阅读(121) 评论(0) 推荐(0)

Keyboard Row

摘要: Given a List of words, return the words that can be typed using letters of alphabet on only one row's of American keyboard like the image below. Examp 阅读全文

posted @ 2017-10-28 16:23 luckygxf 阅读(164) 评论(0) 推荐(0)

2017年10月24日

Number Complement

摘要: Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given inte 阅读全文

posted @ 2017-10-24 23:56 luckygxf 阅读(128) 评论(0) 推荐(0)

Array Partition I

摘要: Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of 阅读全文

posted @ 2017-10-24 23:36 luckygxf 阅读(130) 评论(0) 推荐(0)

2017年10月22日

Merge Two Binary Trees

摘要: Given two binary trees and imagine that when you put one of them to cover the other, some nodes of the two trees are overlapped while the others are n 阅读全文

posted @ 2017-10-22 22:15 luckygxf 阅读(155) 评论(0) 推荐(0)

Judge Route Circle

摘要: Initially, there is a Robot at position (0, 0). Given a sequence of its moves, judge if this robot makes a circle, which means it moves back to the or 阅读全文

posted @ 2017-10-22 21:50 luckygxf 阅读(126) 评论(0) 推荐(0)

上一页 1 ··· 13 14 15 16 17 18 19 20 21 ··· 46 下一页

导航