Metaseniorfev. de 2026
You have a binary tree, you need to implement a iterator which returns a single element, traversing tree in in-order. https://leetcode.com/problems/binary-search-tree-iterator
Implement an iterator over a BST that returns elements in in-order (ascending) via next() and hasNext(), starting before the smallest element so the first next() yields the minimum. Aim for next()/hasNext() to handle up to 1e5 calls with amortized O(1) time and O(h) extra space (h = tree height).
Use esses exemplos para entender em que contexto ela costuma cair e adaptar sua prática.
You have a binary tree, you need to implement a iterator which returns a single element, traversing tree in in-order. https://leetcode.com/problems/binary-search-tree-iterator
Nenhum anexo público associado a esta pergunta.
No app você encontra perguntas parecidas, compara empresas e aprofunda essa busca com mais filtros.