0:00 / 0:00
#tail-recursion#recursion#optimization
Tail Recursion Explained - Computerphile
Computerphile
2.6M subscribers • 66 videos on Hallway
- Recommended by 2 people: 2 in engineering communities.
- Presented by Graham Hutton, Professor of Computer Science at the University of Nottingham
Beginner. No background in the topic needed.
200K views6 years ago2 recommendations
Computer scienceProgramming languagesFunctional programmingAlgorithms
Graham Hutton explains how tail recursion works and how to rewrite recursive functions to make them more efficient.
Improve the efficiency of recursive code by re-writing it to be tail recursive. Professor Graham Hutton explains. EXTRA BITS: youtu.be/eoi3s_4mAAc facebook.com/computerphile twitter.com/computer_phile This video was filmed and edited by Sean Riley. Computer Science at the University of Nottingham: bit.ly/nottscomputer Computerphile is a sister project to Brady Haran's Numberphile. More at bradyharan.comWhy it's here
2 people recommend thisu/MaoStevemaoin r/functionalprogramming • Recommends
Tail Recursion Explained - Computerphile
u/sgaletain r/compsci • Mentions
On “Space complexity of a recursion algorithm”
Recommend this video to understand tail recursion for those who don't:
link to this video
u/VoidNoirein r/C_Programming • Mentions
On “How to minimise causing side-effects?”
I agree, the designated initialiser syntax does seem like it would be a lot less error-prone than what I'm doing currently because it forces you to be less ambiguous about which variables you're initialising.
> No, I mean you should change the actual struct to not have const parameters.
Ah, thanks for the clarification. So just to avoid confusion on my part, you're saying I should do:
typedef struct Characters {
char character;
int amount;
char *output;
bool is_malloced;
} Characters;
Instead of:
typedef struct Characters {
const char character;
const int amount;
char *output;
const bool is_malloced;
} Characters;
Right? O…