摘要: java提供了两种锁机制来控制多个线程对共享资源的互斥访问,第一个是jvm实现的synchronized,而另一个是jdk实现的ReentrantLock。 阅读全文
posted @ 2019-04-13 22:55 yjxyy 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 垃圾收集算法:标记-清除,复制,标记-整理 阅读全文
posted @ 2019-04-13 22:36 yjxyy 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 我们可以用2*1的小矩形横着或者竖着去覆盖更大的矩形。请问用n个2*1的小矩形无重叠地覆盖一个2*n的大矩形,总共有多少种方法? 阅读全文
posted @ 2019-04-13 22:23 yjxyy 阅读(96) 评论(0) 推荐(0) 编辑
摘要: 一只青蛙一次可以跳上1级台阶,也可以跳上2级……它也可以跳上n级。求该青蛙跳上一个n级的台阶总共有多少种跳法。 阅读全文
posted @ 2019-04-13 22:21 yjxyy 阅读(109) 评论(0) 推荐(0) 编辑
摘要: 一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法 阅读全文
posted @ 2019-04-13 22:20 yjxyy 阅读(98) 评论(0) 推荐(0) 编辑
摘要: You are given a binary tree in which each node contains an integer value. Find the number of paths that sum to a given value. 阅读全文
posted @ 2019-04-13 22:16 yjxyy 阅读(143) 评论(0) 推荐(0) 编辑
摘要: Given an array `nums`, write a function to move all `0`'s to the end of it while maintaining the relative order of the non-zero elements. 阅读全文
posted @ 2019-04-13 22:13 yjxyy 阅读(135) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list, determine if it is a palindrome 阅读全文
posted @ 2019-04-13 22:08 yjxyy 阅读(170) 评论(0) 推荐(0) 编辑
摘要: You are a professional robber planning to rob houses along a street. Each house has a certain amount of money stashed, the only constraint stopping you from robbing each of them is that adjacent houses have security system connected and it will automatically contact the police if two adjacent houses were broken into on the same night. 阅读全文
posted @ 2019-04-12 16:25 yjxyy 阅读(213) 评论(0) 推荐(0) 编辑
摘要: Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. 阅读全文
posted @ 2019-04-12 16:22 yjxyy 阅读(109) 评论(0) 推荐(0) 编辑