专栏名称: 每日一道算法题
学习算法是一种信仰,每天都需要坚持!
目录
相关文章推荐
51好读  ›  专栏  ›  每日一道算法题

173. Binary Search Tree Iterator

每日一道算法题  · 公众号  · 算法  · 2017-06-04 00:26

正文

173. Binary Search Tree Iterator


Implement an iterator over a binary search tree (BST). Your iterator will be initialized with the root node of a BST.

Calling next() will return the next smallest number in the BST.

Note: next() and hasNext() should run in average O(1) time and uses O( h ) memory, where h







请到「今天看啥」查看全文