Messy solution.
This commit is contained in:
@@ -1 +1,6 @@
|
||||
This repository contains answers to the assignments of Advent of Coding 2022
|
||||
# Advent of Code 2022 - Assignment7 javascript
|
||||
Assignment 7 involves parsing linux directory commands/results into a tree. The solution defines a root TreeNode first and sets it as currentdirectory. Whenever a cd command is found a new node is created if it does not exist and set to currentdir. Whenever a cd .. is found currentdirectory is set to parent. Whenever a file is found size is recursively increased for current node and parent nodes.
|
||||
|
||||
## References
|
||||
- https://adrianmejia.com/data-structures-for-beginners-trees-binary-search-tree-tutorial/
|
||||
- https://stackoverflow.com/questions/8376525/get-value-of-a-string-after-last-slash-in-javascript
|
||||
|
||||
Reference in New Issue
Block a user