When parsing through the data gathered from du it becomes necessary to determine the correct offset to use when trying to find subtrees. There are four scenarios that can occur:
The next entry is a parent
The next entry is a child
The next entry is a totally new branch
Something went wrong and there's a completely unexpected entry
Given these four instances it's possible to ensure that the correct component is being compared to determine the lineage of any entry. I will be constructing a helper function that finds this offset to keep the computation out of the postOrder() function itself.
When parsing through the data gathered from
du
it becomes necessary to determine the correct offset to use when trying to find subtrees. There are four scenarios that can occur:Given these four instances it's possible to ensure that the correct component is being compared to determine the lineage of any entry. I will be constructing a helper function that finds this offset to keep the computation out of the postOrder() function itself.