Step 4 of 6
Trees and graphs
A tree is data with parents and children: folders, comments with replies, the HTML DOM, database indexes (B-trees). A graph is anything with connections in any direction: social networks, road maps, 'related listings'.
Why it matters when you build with AI: Nested comments, org charts, categories and permissions are trees. Recognizing that saves you from tangled, buggy code.
Quick check
Comments with nested replies are a…
Each reply has one parent: that's a tree.