Skip to content

Bug Report for binary-search-tree-iterator #5329

@iamef

Description

@iamef

Bug Report for https://neetcode.io/problems/binary-search-tree-iterator

Please describe the bug below and include any steps to reproduce the bug or screenshots if possible.

Time complexity for next and hasNext should be O(1)

For solutions

  1. Flattening the BST (DFS) and 2. Flatten the BST (Iterative DFS)
Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions