Skip to content

recursion vs while loop

goungoun edited this page Aug 1, 2024 · 4 revisions

Choosing recursion solves certain problems much easier than using a stack or a queue (using deque).

Here is an example:
Problem: https://leetcode.com/problems/symmetric-tree/description/
Solution: https://github.com/goungoun/leetcode/blob/main/Tree/symetric_tree.py
Clone this wiki locally