mirror of
https://gitlab.com/mfocko/LeetCode.git
synced 2024-11-09 15:59:06 +01:00
fix: correct the comments and interface
Signed-off-by: Matej Focko <mfocko@redhat.com>
This commit is contained in:
parent
5dd35539a5
commit
1f5f1bee8c
1 changed files with 2 additions and 17 deletions
|
@ -2,6 +2,8 @@ import java.util.ArrayDeque;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
// This is the interface that allows for creating nested lists.
|
||||||
|
// You should not implement it, or speculate about its implementation
|
||||||
interface NestedInteger {
|
interface NestedInteger {
|
||||||
// @return true if this NestedInteger holds a single integer, rather than a nested list.
|
// @return true if this NestedInteger holds a single integer, rather than a nested list.
|
||||||
public boolean isInteger();
|
public boolean isInteger();
|
||||||
|
@ -13,23 +15,6 @@ interface NestedInteger {
|
||||||
public List<NestedInteger> getList();
|
public List<NestedInteger> getList();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* // This is the interface that allows for creating nested lists.
|
|
||||||
* // You should not implement it, or speculate about its implementation
|
|
||||||
* public interface NestedInteger {
|
|
||||||
*
|
|
||||||
* // @return true if this NestedInteger holds a single integer, rather than a nested list.
|
|
||||||
* public boolean isInteger();
|
|
||||||
*
|
|
||||||
* // @return the single integer that this NestedInteger holds, if it holds a single integer
|
|
||||||
* // Return null if this NestedInteger holds a nested list
|
|
||||||
* public Integer getInteger();
|
|
||||||
*
|
|
||||||
* // @return the nested list that this NestedInteger holds, if it holds a nested list
|
|
||||||
* // Return empty list if this NestedInteger holds a single integer
|
|
||||||
* public List<NestedInteger> getList();
|
|
||||||
* }
|
|
||||||
*/
|
|
||||||
class NestedIterator implements Iterator<Integer> {
|
class NestedIterator implements Iterator<Integer> {
|
||||||
|
|
||||||
private class DFSEntry {
|
private class DFSEntry {
|
||||||
|
|
Loading…
Reference in a new issue