Skip to content
DevMeme
2304 of 7590
CS Fundamentals Post #2563 · source on Telegram

A Computer Science Guide to Search Algorithms

Description

A five-panel comic illustrating various tree traversal algorithms in the minimalist style of XKCD. The first two panels correctly depict 'DEPTH-FIRST SEARCH', showing a path that explores as far as possible down one branch before backtracking, and 'BREADTH-FIRST SEARCH', which explores nodes level by level. The next two panels introduce nonsensical joke variations: 'BREPTH-FIRST SEARCH' shows a chaotic, tangled path, and 'DEADTH-FIRST SEARCH' shows a path that seems to get stuck in a loop and terminate prematurely. The final, largest panel delivers the punchline with 'BREAD-FIRST SEARCH', where the traversal path starts at the root node of the tree and leads directly to a drawing of a loaf of bread, completely outside the data structure. The humor is a classic pun, playing on the similar-sounding 'breadth' and 'bread', a type of dry, nerdy wit that is very popular in developer and computer science communities

Comments

21
Anonymous ★ Top Pick My manager asked for a bread-first search of the codebase. I found a TODO from 2015 commenting on 'a slice of technical debt'
  1. Anonymous ★ Top Pick

    My manager asked for a bread-first search of the codebase. I found a TODO from 2015 commenting on 'a slice of technical debt'

  2. Anonymous

    We typo’d BFS as “Bread-First Search” in the design doc - now the crawler scales elegantly across bakeries, but the complexity is O(gluten) and the SRE runbook just says “BYO toaster.”

  3. Anonymous

    After 20 years of explaining BFS vs DFS to junior devs, you realize the real optimization is just following the smell of fresh bread from the office kitchen - O(1) time complexity for finding happiness

  4. Anonymous

    When your breadth-first search implementation is so hungry for optimization that it skips the entire graph traversal and goes straight for the carbs - because why explore O(V+E) nodes when you can achieve O(1) satisfaction at the bakery? Classic case of premature optimization meeting basic human needs

  5. Anonymous

    Brepth-first search: the traversal you get after a “perf refactor” that mixes DFS recursion with a shared BFS queue - nondeterministic order, heap thrash, and an on-call runbook for Deadth-first (then Bread-first)

  6. Anonymous

    We argue DFS vs BFS trade‑offs, but in production the only complete strategy is Bread‑First Search - a greedy algorithm that minimizes MTTR by maximizing pastry throughput

  7. Anonymous

    Death-First Search: chasing a bug deep through 47 microservices, only to hang in a circular dependency noose

  8. @lilshredder 5y

    Death first search

    1. @Vitalis11 5y

      +

  9. Deleted Account 5y

    last search

  10. Deleted Account 5y

    Please provide attribution when posting XKCD content, it's CC BY-NC

    1. @feskow 5y

      Bruh or else?

      1. Deleted Account 5y

        it's a copyright violation

        1. @feskow 5y

          And... Someone's gonna shut down the channel?

          1. Deleted Account 5y

            it's pretty easy actually

          2. @dugeru42 5y

            and some people will miss opportunity to check out discussions of this xkcd

            1. @feskow 5y

              I'm sure there's no person who doesn't knows the author or how to find the author

              1. Deleted Account 5y

                of course there are

              2. @dugeru42 5y

                ok, name every xkcd

  11. @ryankrage77 5y

    https://m.xkcd.com/2407/

  12. @OomatL 5y

    what is that?

Use J and K for navigation