原题链接在这里:https://leetcode.com/problems/design-bounded-blocking-queue/ 题目: Implement a thread safe bounded blocking queue that has the following methods ...
分类:
其他好文 时间:
2020-02-13 09:51:44
阅读次数:
70
在java里类的关系大致分为三种, 1.继承(a is b):继承extends,实现implement 2.包含(a has b):组合>聚合>关联。关系亲密度越来越小,一个类在另一个类中声明为属性。 3.依赖(a use b):一个类中用到了别的类对象,比如a类的方法中创建b的对象并使用其属性跟 ...
分类:
编程语言 时间:
2020-02-11 14:21:46
阅读次数:
72
题目: Implement a MapSum class with insert, and sum methods. For the method insert, you'll be given a pair of (string, integer). The string represents t ...
分类:
编程语言 时间:
2020-02-11 00:19:01
阅读次数:
110
Design and implement a data structure for Least Recently Used (LRU) cache. It should support the following operations: get and put. get(key) - Get the ...
分类:
系统相关 时间:
2020-02-10 09:57:46
阅读次数:
68
题目如下: Implement the class TweetCounts that supports two methods: 1. recordTweet(string tweetName, int time) Stores the tweetName at the recorded time ...
分类:
其他好文 时间:
2020-02-09 18:10:45
阅读次数:
50
How would you implement mergesort without using recursion? The idea of iterative mergesort is to start from N sorted sublists of length 1, and each ti ...
分类:
其他好文 时间:
2020-02-03 13:35:41
阅读次数:
117
链接 https://leetcode-cn.com/problems/implement-stack-using-queues/ 思路 首先演示push()操作;将元素依次进入队1,进入时用top元素保存当前进入的元素;如下图: push操作的演示 然后演示pop()操作;先将除队1中的最后一个元 ...
分类:
编程语言 时间:
2020-02-03 09:39:08
阅读次数:
74
The method getByName(String) of type UserServiceImpl must override or implement a supertype method 翻译:UserServiceImpl类型的getByName(String)方法必须覆盖或实现超类型方 ...
分类:
其他好文 时间:
2020-02-01 19:18:13
阅读次数:
100
题目链接 https://leetcode-cn.com/problems/implement-queue-using-stacks/ 题目描述 使用栈实现队列的下列操作: push(x) -- 将一个元素放入队列的尾部。pop() -- 从队列首部移除元素。peek() -- 返回队列首部的元素。 ...
分类:
编程语言 时间:
2020-02-01 11:00:22
阅读次数:
91