Eight Megabytes Of Frames
A C++ DFS uses one stack frame per node. Built without optimization, each frame is 96 bytes: two 8-byte pointers, an int, an adjacency iterator, saved registers, and alignment padding. The thread runs with the common 8 MiB default stack.
How deep can the recursion go, and does a DFS over a 200,000-node path graph fit?
Sign in to answer questions and track your progress
Sign In