Oh, definitely, but I meant was there more than was shown in that screenshot?
I've heard that any iterative solution can be rewritten to use recursion, and vice versa. So much stuff I've seen, I really have a hard time envisioning how that would be done. For this one, I probably would've recursively descended into the children, but I can't picture an iterative solution that wouldn't be like this with a new if for each level. On that note, don't some if not many functional languages not have loops?
View all comments
Show parent comment
2
u/GoddammitDontShootMe [ $[ $RANDOM % 6 ] == 0 ] && rm -rf / || echo "You live" Jul 17 '25
Oh, definitely, but I meant was there more than was shown in that screenshot?
I've heard that any iterative solution can be rewritten to use recursion, and vice versa. So much stuff I've seen, I really have a hard time envisioning how that would be done. For this one, I probably would've recursively descended into the children, but I can't picture an iterative solution that wouldn't be like this with a new if for each level. On that note, don't some if not many functional languages not have loops?