trekhleb / javascript-algorithms

📝 Algorithms and data structures implemented in JavaScript with explanations and links to further readings
MIT License
186.76k stars 30.07k forks source link

BFS image has a generic tree in it, but the algorithm only works with a binary trees #434

Open wips opened 4 years ago

wips commented 4 years ago

The image here shows a generic tree (3 children on the first level from root), while the algorithm's code is for binary tree only. Moreover, the algorithm is in the tree/ subfolder, maybe it worth naming it binary-tree?

miningape commented 4 years ago

It works on a normal tree too, but this implementation with binary tree