マツシタのお勉強

Iterator

Binary Search Tree Iterator in LeetCode

問題 Binary Search Treeにおけるイテレータを実装する問題。next()メソッドで取得できる値は現時点での最小値となる。 Binary Search Tree Iterator - LeetCode ソースコード

281. Zigzag Iterator : Past Google Coding Interview

Problem https://leetcode.com/problems/zigzag-iterator/ How to Solve By using Iterator and Queue, I can solve this problem. Iterator ListIterator (Java Platform SE 8 ) An iterator for lists that allows the programmer to traverse the list in…