3 ms·
Complaining that breadth-first-search is irrelevant to frontend dev seems concerning to me. The DOM is a tree; so are JSON structures; so are website directory
by jameshart 11y ago
Complaining that breadth-first-search is irrelevant to frontend dev seems concerning to me. The DOM is a tree; so are JSON structures; so are website directory structures; so are half the data structures you will encounter in most businesses (departments, categories, etc.). You WILL need to traverse a tree in a frontend position at some point. I absolutely want to know whether a frontend developer has a variety of tools in their toolbox for handling tree structured data - and ideally the ability to refactor between recursion (using the call stack), explicit stack descent (which will be depth first), and queue based descent (which will be breadth first).
- cc81 11y agoThat would be incredibly rare to implement a breadth first algorithm in front end work. I mean you could pick any question about the most obscure browser quirks would probably be more relevant.