惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

U
Unit 42
Vercel News
Vercel News
博客园 - 叶小钗
大猫的无限游戏
大猫的无限游戏
MyScale Blog
MyScale Blog
P
Proofpoint News Feed
量子位
Engineering at Meta
Engineering at Meta
B
Blog RSS Feed
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
Google DeepMind News
Google DeepMind News
D
DataBreaches.Net
Stack Overflow Blog
Stack Overflow Blog
博客园 - 聂微东
小众软件
小众软件
Hugging Face - Blog
Hugging Face - Blog
人人都是产品经理
人人都是产品经理
IT之家
IT之家
T
The Blog of Author Tim Ferriss
Last Week in AI
Last Week in AI
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
Jina AI
Jina AI
博客园 - 三生石上(FineUI控件)

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Recursion Isn’t Hard. The Call Stack Is Invisible
N Satyadev · 2026-05-19 · via DEV Community

N Satyadev

Ever went through a simple DFS code and went "I would rather beat an old lady with a stick"?

A simple recursive inorder traversal code

That was me until I wasn't.

  • You know what trees are.
  • You also know how the traversals work.
  • Yet you seem to never truly grasp recursive tree traversals.

The problem seems much deeper than "I suck at recursion".

The "Tutorial Hell" Phase

Facing the problem myself, I tried many things — from getting into tutorial hell to solving problems on HackerRank, LeetCode but... does that even work?
In my case, a clear NO.

The Breakthrough: Manual Simulation

The solution is finding out what is actually stopping you from using trees. Play around with it, understand what a call stack is.
Simulate recursion without using recursion (yup, that is a thing) yourself by maintaining a manual call stack on a piece of paper or any programming language.

C function that tracks

A C program that implements inorder traversal while maintaining a manual call stack

Notes that shows maintaining manual call stack on a piece of paper

Now the conclusion is — you understand everything, yet those 3 lines seem magical. That is probably because you are not doing the heavy lifting here.
Recursion takes care of that, and you don't see how.

The Strategy: Walkthrough the problem

The most basic fix? Just be a human.

While developing one of my projects I ran into this exact issue again. What did I do? The exact thing I mentioned above.
I Wrote down the problem, went through it step by step. Made sure I knew what I was looking for before I even touched that damn keyboard.

Let us say the expression is: a=b AND b=c. If someone says, "write code to make it a tree," it might feel like they asked you to poop gold which somehow seems much more reasonable. But it is really not that complex.
The best thing to do at this point is probably ignore all the complex terminologies like LR, LL parsers etc which makes it intimidating. At the core it's all about converting a human thinking process into machine code.

Notes on how a tree can be generated out of expression

The "how" becomes pretty easy from here.
You know AND is the root, and each left and right side is again a sub-tree with its operator as the root.
The simplest approach (to understand recursion) is to manually check the sequence and advance. Each lexeme is just a node with a value and left/right pointers.
A tree is just connections of pointers and recursion is all about returning those pointers in a very strategic way.

Conclusion

Once recursion starts feeling fun — congratulations, it’s over. You’re a nerd now.

If you have been trying to figure out recursion for 67th time now... take a break, touch some grass, come back and make sure you C problems in a human way before attempting to solve like a machine.


PS: Using AI tools like Gemini, Claude, or ChatGPT isn't too bad for understanding such topics either — they add to your existing understanding rather than replacing it.

TLDR: Simulate before you code. Draw before you type. Be a human first, a programmer second.