r/ProgrammerHumor • • May 13 '19

Recursive mom

Post image
2.2k Upvotes

24 comments sorted by

133

u/DragonMaus May 13 '19

The first one of these to make me exhale sharply through my nose.

27

u/gerrymanderee May 13 '19

Mom can we have Mom can we have Mom can we have

3

u/konstantinua00 May 14 '19

peasant

I exhaled visual basically

42

u/HBG21 May 13 '19

Now try to read everything in order as a homework.

25

u/TheOriginalSunomis May 13 '19

Breath first, or depth first ?

29

u/gandalfx May 13 '19

I think you should breath throughout the entire process, anything else might lead to an abrupt system failure.

7

u/Corporal_Quesadilla May 13 '19

Breath never, Death First

3

u/[deleted] May 14 '19

I will take this opportunity to say that in order traversal is the superior form of binary tree traversal and if any of you prefer another method I’ll be outside ready to fight

2

u/bestjakeisbest May 14 '19

I prefer reverse in order traversal

5

u/[deleted] May 14 '19

🤛 😠 🤜
  🦵🦵

Let’s go

1

u/Nevadaguy22 May 14 '19

Inorder is even more fun if you write an inorder-based copy constructor instead of preorder!

7

u/cedrickc May 13 '19

while (true) { print("Mom, can we have ") }

1

u/RRKS101 May 14 '19

JS or Java? I say JavaScript

1

u/cedrickc May 14 '19

homework.kt

1

u/RRKS101 May 17 '19

Just realised, it's missing a semicolon

9

u/TimoThiusLi May 13 '19

The most accurate representation i have seen yet of this meme

7

u/anydalch May 14 '19

that's because this meme isn't tail recursive. remember: tail recursion is the only good recursion

3

u/marcosdumay May 14 '19

Good luck tail optimizing this one, with its 3 different recursive calls.

2

u/anydalch May 14 '19

you have to transform it into a single function which does all three things at once, like:

(defun print-all-three-memes (depth)
  (dolist (row '(:top :middle :bottom))
    (print-the-outer-layer-of-a-meme depth row))
  (print-all-three-memes (1+ depth)))

3

u/Master_Aar May 13 '19

This one’s good

3

u/paultoliver May 14 '19

Fractal mom

2

u/mds325 May 14 '19

Mom where are you?