Skip to content
This repository has been archived by the owner on Feb 4, 2024. It is now read-only.

Optimize the tree traversal by utilizing memoization #5

Closed
nizarmah opened this issue Mar 24, 2022 · 0 comments · Fixed by #6
Closed

Optimize the tree traversal by utilizing memoization #5

nizarmah opened this issue Mar 24, 2022 · 0 comments · Fixed by #6

Comments

@nizarmah
Copy link
Owner

This change can be optimized in the future.

Imagine passing two directories as parameters, one is ~/A and the other is ~/A/B.

At the moment, the program traverse both ~/A and ~/A/B. However, we're traversing ~/A/B twice.

This can be optimized by using memoization. That way we wouldn't have to re-traverse ~/A/B. Instead, we can just point towards that Node.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant