frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

Iterative DFS with stack-based graph traversal (2024)

https://dwf.dev/blog/2024/09/23/2024/dfs-iterative-stack-based
29•cpp_frog•3d ago

Comments

ad-astra•3h 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•3h 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.

almostgotcaught•2h 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...

Why is choral music harder to appreciate?

https://marginalrevolution.com/marginalrevolution/2025/08/why-is-choral-music-harder-to-appreciat...
12•surprisetalk•2d ago•5 comments

Show HN: Sping – An HTTP/TCP latency tool that's easy on the eye

https://dseltzer.gitlab.io/sping/docs/
83•zorlack•5h ago•5 comments

Git-Annex

https://git-annex.branchable.com/
7•keepamovin•1h ago•0 comments

Busy beaver hunters reach numbers that overwhelm ordinary math

https://www.quantamagazine.org/busy-beaver-hunters-reach-numbers-that-overwhelm-ordinary-math-202...
72•defrost•2d ago•14 comments

From Hackathon to YC

https://www.producthunt.com/p/april-yc-s25/from-hackathon-to-yc
12•rmason•7h ago•9 comments

The two versions of Parquet

https://www.jeronimo.dev/the-two-versions-of-parquet/
147•tanelpoder•3d ago•34 comments

We put a coding agent in a while loop

https://github.com/repomirrorhq/repomirror/blob/main/repomirror.md
168•sfarshid•13h ago•115 comments

Is 4chan the perfect Pirate Bay poster child to justify wider UK site-blocking?

https://torrentfreak.com/uk-govt-finds-ideal-pirate-bay-poster-boy-to-sell-blocking-of-non-pirate...
200•gloxkiqcza•12h ago•178 comments

The Unix-Haters Handbook (1994) [pdf]

https://simson.net/ref/ugh.pdf
15•oliverkwebb•4h ago•2 comments

Ghrc.io appears to be malicious

https://bmitch.net/blog/2025-08-22-ghrc-appears-malicious/
281•todsacerdoti•5h ago•36 comments

Trees on city streets cope with drought by drinking from leaky pipes

https://www.newscientist.com/article/2487804-trees-on-city-streets-cope-with-drought-by-drinking-...
160•bookofjoe•2d ago•85 comments

Y Combinator files brief supporting Epic Games, says store fees stifle startups

https://www.macrumors.com/2025/08/21/y-combinator-epic-games-amicus-brief/
129•greenburger•3d ago•117 comments

Burner Phone 101

https://rebeccawilliams.info/burner-phone-101/
308•CharlesW•4d ago•124 comments

Making games in Go: 3 months without LLMs vs. 3 days with LLMs

https://marianogappa.github.io/software/2025/08/24/i-made-two-card-games-in-go/
270•maloga•14h ago•190 comments

A Brilliant and Nearby One-off Fast Radio Burst Localized to 13 pc Precision

https://iopscience.iop.org/article/10.3847/2041-8213/adf62f
55•gnabgib•9h ago•8 comments

Everything I know about good API design

https://www.seangoedecke.com/good-api-design/
231•ahamez•10h ago•85 comments

Show HN: Decentralized Bitcoin Incentives via QR Codes

https://github.com/DT7QR/Bitcoin-Rewards-System-Proposal
9•Yodan2025•3h ago•0 comments

Cloudflare incident on August 21, 2025

https://blog.cloudflare.com/cloudflare-incident-on-august-21-2025/
155•achalshah•3d ago•32 comments

Bash Strict Mode (2014)

http://redsymbol.net/articles/unofficial-bash-strict-mode/
34•dcminter•2d ago•27 comments

Uncle Sam shouldn't own Intel stock

https://www.wsj.com/opinion/uncle-sam-shouldnt-own-intel-stock-ccd6986d
106•aspenmayer•7h ago•114 comments

Show HN: Clearcam – Add AI object detection to your IP CCTV cameras

https://github.com/roryclear/clearcam
170•roryclear•17h ago•47 comments

How many paths of length K are there between A and B? (2021)

https://horace.io/walks
22•jxmorris12•9h ago•4 comments

Halt and Catch Fire Syllabus (2021)

https://bits.ashleyblewer.com/halt-and-catch-fire-syllabus/
122•Kye•8h ago•34 comments

My ZIP isn't your ZIP: Identifying and exploiting semantic gaps between parsers

https://www.usenix.org/conference/usenixsecurity25/presentation/you
50•layer8•3d ago•19 comments

Claim: GPT-5-pro can prove new interesting mathematics

https://twitter.com/SebastienBubeck/status/1958198661139009862
129•marcuschong•4d ago•87 comments

Show HN: I Built a XSLT Blog Framework

https://vgr.land/content/posts/20250821.xml
41•vgr-land•11h ago•16 comments

Comet AI browser can get prompt injected from any site, drain your bank account

https://twitter.com/zack_overflow/status/1959308058200551721
508•helloplanets•14h ago•177 comments

How to check if your Apple Silicon Mac is booting securely

https://eclecticlight.co/2025/08/21/how-to-check-if-your-apple-silicon-mac-is-booting-securely/
64•shorden•5h ago•13 comments

NASA's Juno mission leaves legacy of science at Jupiter

https://www.scientificamerican.com/article/how-nasas-juno-probe-changed-everything-we-know-about-...
68•apress•3d ago•29 comments

Stepanov's biggest blunder? The curious case of adjacent difference

https://mmapped.blog/posts/43-stepanovs-biggest-blunder
44•signa11•3d ago•10 comments