code-chronicles-code / code-chronicles-code/leetcode-curriculum
Investigate performance of delegating `yield` in tree traversals
未关闭
enhancement
- 主要语言
- TypeScript
- 星标
- 20
- 派生
- 12
- PR 合并指标
- 30 天内没有已合并 PR
描述
It would be really cool if we could use `yield*` (TypeScript) and `yield from` (Python) or perhaps even `Stream.concat` (Java) in the tree traversal goodies to write the traversals recursively -- the code would read very naturally. However, I'm not sure about the performance implications of doing so.
Let's investigate the performance of these relative to the implementations that manage their own stack. If the recursive implementation is comparable in performance, then I think it should win on the grounds of the code being much nicer.
贡献指南
评估
这个 Issue 还没有评估数据。