frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Jon Stewart – One of My Favorite People – What Now? With Trevor Noah Podcast [video]

https://www.youtube.com/watch?v=44uC12g9ZVk
1•consumer451•1m ago•1 comments

P2P crypto exchange development company

1•sonniya•14m ago•0 comments

Vocal Guide – belt sing without killing yourself

https://jesperordrup.github.io/vocal-guide/
1•jesperordrup•19m ago•0 comments

Write for Your Readers Even If They Are Agents

https://commonsware.com/blog/2026/02/06/write-for-your-readers-even-if-they-are-agents.html
1•ingve•20m ago•0 comments

Knowledge-Creating LLMs

https://tecunningham.github.io/posts/2026-01-29-knowledge-creating-llms.html
1•salkahfi•20m ago•0 comments

Maple Mono: Smooth your coding flow

https://font.subf.dev/en/
1•signa11•27m ago•0 comments

Sid Meier's System for Real-Time Music Composition and Synthesis

https://patents.google.com/patent/US5496962A/en
1•GaryBluto•35m ago•1 comments

Show HN: Slop News – HN front page now, but it's all slop

https://dosaygo-studio.github.io/hn-front-page-2035/slop-news
4•keepamovin•36m ago•1 comments

Show HN: Empusa – Visual debugger to catch and resume AI agent retry loops

https://github.com/justin55afdfdsf5ds45f4ds5f45ds4/EmpusaAI
1•justinlord•38m ago•0 comments

Show HN: Bitcoin wallet on NXP SE050 secure element, Tor-only open source

https://github.com/0xdeadbeefnetwork/sigil-web
2•sickthecat•40m ago•1 comments

White House Explores Opening Antitrust Probe on Homebuilders

https://www.bloomberg.com/news/articles/2026-02-06/white-house-explores-opening-antitrust-probe-i...
1•petethomas•41m ago•0 comments

Show HN: MindDraft – AI task app with smart actions and auto expense tracking

https://minddraft.ai
2•imthepk•46m ago•0 comments

How do you estimate AI app development costs accurately?

1•insights123•47m ago•0 comments

Going Through Snowden Documents, Part 5

https://libroot.org/posts/going-through-snowden-documents-part-5/
1•goto1•47m ago•0 comments

Show HN: MCP Server for TradeStation

https://github.com/theelderwand/tradestation-mcp
1•theelderwand•50m ago•0 comments

Canada unveils auto industry plan in latest pivot away from US

https://www.bbc.com/news/articles/cvgd2j80klmo
3•breve•51m ago•1 comments

The essential Reinhold Niebuhr: selected essays and addresses

https://archive.org/details/essentialreinhol0000nieb
1•baxtr•54m ago•0 comments

Rentahuman.ai Turns Humans into On-Demand Labor for AI Agents

https://www.forbes.com/sites/ronschmelzer/2026/02/05/when-ai-agents-start-hiring-humans-rentahuma...
1•tempodox•55m ago•0 comments

StovexGlobal – Compliance Gaps to Note

1•ReviewShield•58m ago•1 comments

Show HN: Afelyon – Turns Jira tickets into production-ready PRs (multi-repo)

https://afelyon.com/
1•AbduNebu•59m ago•0 comments

Trump says America should move on from Epstein – it may not be that easy

https://www.bbc.com/news/articles/cy4gj71z0m0o
7•tempodox•1h ago•4 comments

Tiny Clippy – A native Office Assistant built in Rust and egui

https://github.com/salva-imm/tiny-clippy
1•salvadorda656•1h ago•0 comments

LegalArgumentException: From Courtrooms to Clojure – Sen [video]

https://www.youtube.com/watch?v=cmMQbsOTX-o
1•adityaathalye•1h ago•0 comments

US moves to deport 5-year-old detained in Minnesota

https://www.reuters.com/legal/government/us-moves-deport-5-year-old-detained-minnesota-2026-02-06/
8•petethomas•1h ago•3 comments

If you lose your passport in Austria, head for McDonald's Golden Arches

https://www.cbsnews.com/news/us-embassy-mcdonalds-restaurants-austria-hotline-americans-consular-...
1•thunderbong•1h ago•0 comments

Show HN: Mermaid Formatter – CLI and library to auto-format Mermaid diagrams

https://github.com/chenyanchen/mermaid-formatter
1•astm•1h ago•0 comments

RFCs vs. READMEs: The Evolution of Protocols

https://h3manth.com/scribe/rfcs-vs-readmes/
3•init0•1h ago•1 comments

Kanchipuram Saris and Thinking Machines

https://altermag.com/articles/kanchipuram-saris-and-thinking-machines
1•trojanalert•1h ago•0 comments

Chinese chemical supplier causes global baby formula recall

https://www.reuters.com/business/healthcare-pharmaceuticals/nestle-widens-french-infant-formula-r...
2•fkdk•1h ago•0 comments

I've used AI to write 100% of my code for a year as an engineer

https://old.reddit.com/r/ClaudeCode/comments/1qxvobt/ive_used_ai_to_write_100_of_my_code_for_1_ye...
3•ukuina•1h ago•1 comments
Open in hackernews

Iterative DFS with stack-based graph traversal (2024)

https://dwf.dev/blog/2024/09/23/2024/dfs-iterative-stack-based
39•cpp_frog•5mo ago

Comments

ad-astra•5mo ago
Thanks for sharing! I had come across similar kinds of issues on my annual LeetCode prep and this very clear articulation is very helpful. Props to the author for making this so easy to visualize.
dinobones•5mo ago
I’m surprised this isn’t a more common and well known issue.

I stumbled upon this issue when trying to convert a recursive DFS to iterative because my recursive DFS was running out of stack space.

The solution produced by this iterative version was wrong, completely different from the recursive implementation.

It’s fascinating how many primitive, basic algorithms are probably implemented incorrectly but work just well enough that no one ever cares or notices… reminds me of how so many text books have an incorrect or overflowing version of binary search.

pss314•5mo ago
reminds me of how so many text books have an incorrect or overflowing version of binary search.

Extra, Extra - Read All About It: Nearly All Binary Searches and Mergesorts are Broken https://research.google/blog/extra-extra-read-all-about-it-n...

imtringued•5mo ago
Why would it be a common issue?

People usually implement graph traversal first and only after that do they choose a FIFO queue for BFS or a stack for DFS as their data structure.

almostgotcaught•5mo ago
This is already the standard stack based DFS?

  def dfs(graph, source):
    n = len(graph)
    visited = set()
    stack = [source]
    
    while stack:
      node = stack.pop()
      if node in visited:
        continue 
      visited.add(node)
      for nbr in graph[node]:
        stack.append(nbr)
So I don't know what all the confusion is about...
nicoty•5mo ago
I implemented an iterative, stack-based DFS iterator in JS last year for a project that I didn't end up using it on. Maybe someone else can find some use of it: https://gist.github.com/nothingnesses/5f974a43a2da5d1d8a6b9c...
quibono•5mo ago
So... am I misunderstanding or is it enough to swap the iteration over the neighbours of a node and the visited check?

          for nbr in graph[node]:
            if not visited[nbr]:
into

          if node in visited: continue
          visited.add(node)
          for nbr in graph[node]:
              stack.append(nbr)
DannyBee•5mo ago
It should be enough :)
DannyBee•5mo ago
One thing to keep in mind (which the original cited article in this article gets right, but this article gets wrong) - there is no guarnateed unique ordering of children visitation for nodes with >1 child. The parts they copy from the original article talk about this correctly, the parts they didn't, don't :)

The DFS orderings where the children visitation is swapped, etc, are all still equally correct and valid. That is - a DFS algorithm that randomized the children order is still valid.

IE for example, if you change the "for nbr in graph[node]" line to "for nbr in reversed(sorted(graph[node]))", the resulting DFS ordering is still valid and correct.

If you want them in a specific ordering, you'd usually have to force them into it in the algorithm. It rarely makes sense to try to force the structure to be ordered (as they do here) for the algorithm.

This often hits people who use graphs with pointers, or multiple threads, or ...