code-chronicles-code / code-chronicles-code/leetcode-curriculum

Investigate performance of delegating `yield` in tree traversals

Open
#300 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
TypeScript
Stars
20
Forks
12
PR merge metrics
No merged PRs in 30d

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.