leetcode
search
Ctrlk
leetcode
  • Introduction
  • Topic summary
    • Backtracking
    • Dynamic programming
    • Binary search
    • Tree
    • DFS BFS
    • Union-Find & 2D matrix
    • Graph
    • Sliding Window
    • Sorting
    • Advanced algorithm
    • Data Structure
    • Bit Manipulation
    • Edge cases - input validation
    • String
    • Array
    • Stack
    • Heap
    • LinkedList
    • Greedy
    • design
    • Trie
  • System Design
  • Solutions
gitbookPowered by GitBook
block-quoteOn this pagechevron-down
  1. Topic summary

design

  • hasNext() next() can be called independently

  • for safety, call hasNext() before next()

  • cant store all data in advance

https://leetcode.com/problems/binary-search-tree-iteratorarrow-up-right https://leetcode.com/problems/flatten-nested-list-iteratorarrow-up-right https://leetcode.com/problems/peeking-iteratorarrow-up-right https://leetcode.com/problems/zigzag-iteratorarrow-up-right https://leetcode.com/problems/flatten-2d-vectorarrow-up-right https://leetcode.com/problems/design-compressed-string-iteratorarrow-up-right

PreviousGreedychevron-leftNextTriechevron-right

Last updated 4 years ago