题目如下: Given a nested list of integers, implement an iterator to flatten it. Each element is either an integer, or a list -- whose elements may also be ...
分类:
其他好文 时间:
2019-11-25 11:22:22
阅读次数:
54
Given an Iterator class interface with methods: next() and hasNext(), design and implement a PeekingIterator that support the peek() operation -- it e ...
分类:
其他好文 时间:
2019-11-24 10:12:24
阅读次数:
58
Implement a trie with insert, search, and startsWith methods. Example: Trie trie = new Trie(); trie.insert("apple"); trie.search("apple"); // returns ...
分类:
其他好文 时间:
2019-11-19 13:53:15
阅读次数:
65
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 ...
分类:
系统相关 时间:
2019-11-16 21:35:33
阅读次数:
88
对象的类型——接口 在 TypeScript 中,我们使用接口(Interfaces)来定义对象的类型。 什么是接口 在面向对象语言中,接口(Interfaces)是一个很重要的概念,它是对行为的抽象,而具体如何行动需要由类(classes)去实现(implement)。 TypeScript 中的 ...
分类:
其他好文 时间:
2019-11-03 01:14:18
阅读次数:
78
Implement the following operations of a stack using queues. push(x) -- Push element x onto stack. pop() -- Removes the element on top of the stack. to ...
分类:
其他好文 时间:
2019-11-02 12:00:10
阅读次数:
65
1.接口中的属性只能用 static final 修饰,而且必须定义初始值 2.接口中的所有方法却不都是抽象方法 3.接口不能实例化 ,接口中不能有构造方法 4.接口之间可以相互继承,但是接口不能继承类 5.接口的实现类中必须重写接口中的全部方法 6.实现接口的关键字:implement 语法: 修 ...
分类:
其他好文 时间:
2019-11-01 13:14:39
阅读次数:
81
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 front ...
分类:
其他好文 时间:
2019-11-01 12:33:34
阅读次数:
117
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 ...
分类:
系统相关 时间:
2019-10-29 09:52:12
阅读次数:
89
50. Pow(x, n) Medium 10082426FavoriteShare 50. Pow(x, n) Medium 10082426FavoriteShare Medium Implement pow(x, n), which calculates x raised to the pow ...
分类:
其他好文 时间:
2019-10-27 22:52:02
阅读次数:
102