The pseudo-code of BFS is all of 20 lines, and that&#x27;s accounting for a graph possibly containing cycles. A graph without cycles (such as a tree) would be even simpler&#x2F;shorter.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Breadth-first_search" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Breadth-first_search</a><p>Correct arg parsing is actually significantly more complicated in comparison because of all the possibilities and edge cases.<p>&gt; Never (!) homebrew that shit unless you have to (like, you&#x27;re in an embedded environment or your use case requires some bleeding edge research algorithm).<p>I can&#x27;t help but think this mentality is what lead to the recent left-pad debacle