4 ms·
They all got through the interview process so I'm pretty confident about 80% of them would be able to do it and 100% of them would be able to implement BFS. Al
by Xyik 10y ago
They all got through the interview process so I'm pretty confident about 80% of them would be able to do it and 100% of them would be able to implement BFS.
Also yes it's a basic graph algorithm everyone learns, but its inherently much more complicated than BFS which is a simple traversal. It's like bubble sort vs radix sort ... which makes this kind of a loaded question.
- tptacek 10y agoNow, I didn't say BFS, did I? :) I expect they can all do BFS, because your interview process apparently requires that.
- Morgawr 10y agoThe parent was talking about BFS, it's not exactly clear to me why you're asking about Dijkstra's. The two things are entirely different and, as the parent said, it's akin to asking bubblesort vs radix sort.
- tptacek 10y agoMy point is that they are not entirely different; both are academic, simple, basic applications of the kind of graph theory freshmen learn. Described in terms of a heap, Djikstra is barely more complicated than BFS.
- Morgawr 10y agoBFS is far from academic though, it's a very common tree/graph traversal algorithm when you want to traverse in-order, like propagation of events in a UI, or printing contents of a nested data structure for debugging purposes, or searching for the top-most element in a tree that meets your criteria so you can insert a new child subtree (very common operation in nested GUI). Hell, it's not even such an alien concept for a web/frontend developer...
- tptacek 10y agoI mean "academic" in the sense of "basic". SPF is one of the most fundamental problems in applied graph theory.