上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 46 下一页
摘要: >Reverse bits of a given 32 bits unsigned integer.>For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), retu... 阅读全文
posted @ 2015-07-07 22:57 卖程序的小歪 阅读(137) 评论(0) 推荐(0) 编辑
摘要: >Implement the following operations of a queue using stacks.>push(x) -- Push element x to the back of queue.>pop() -- Removes the element from in fron... 阅读全文
posted @ 2015-07-07 20:56 卖程序的小歪 阅读(174) 评论(0) 推荐(0) 编辑
摘要: # ACID 阅读全文
posted @ 2015-07-07 00:32 卖程序的小歪 阅读(161) 评论(0) 推荐(0) 编辑
摘要: >Given a list of non negative integers, arrange them such that they form the largest number.>For example, given [3, 30, 34, 5, 9], the largest formed ... 阅读全文
posted @ 2015-07-06 21:47 卖程序的小歪 阅读(138) 评论(0) 推荐(0) 编辑
摘要: >Given an integer, write a function to determine if it is a power of two.这是计算数中1的个数的简版,如果是2的幂的话,二进制中应该只有一个bit为1,即1的count=1。所以这里就不需要用循环了,一次判断即可。但是入参是有符... 阅读全文
posted @ 2015-07-06 09:57 卖程序的小歪 阅读(189) 评论(0) 推荐(0) 编辑
摘要: ```The demons had captured the princess (P) and imprisoned her in the bottom-right corner of a dungeon. The dungeon consists of M x N rooms laid out i... 阅读全文
posted @ 2015-07-05 15:35 卖程序的小歪 阅读(140) 评论(0) 推荐(0) 编辑
摘要: >A city's skyline is the outer contour of the silhouette formed by all the buildings in that city when viewed from a distance. Now suppose you are giv... 阅读全文
posted @ 2015-07-04 16:38 卖程序的小歪 阅读(299) 评论(0) 推荐(0) 编辑
摘要: ```Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST... 阅读全文
posted @ 2015-07-03 16:50 卖程序的小歪 阅读(998) 评论(0) 推荐(0) 编辑
摘要: ```Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattene... 阅读全文
posted @ 2015-06-30 21:18 卖程序的小歪 阅读(134) 评论(0) 推荐(0) 编辑
摘要: 首先向Doug Lea致敬。# CLH以下是CLH锁的一个简单实现:```javaclass SimpleCLHLock { /** * initialized with a dummy node */ private Node dummy = new Node(); ... 阅读全文
posted @ 2015-06-30 01:10 卖程序的小歪 阅读(489) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 46 下一页