VehiclesFashionRecipesBlogsHuntTravelsSportFunHandmadeITEducation
Mini-Games
x

x
zakruti.com » IT - Software » freeCodeCamp.org
Recursion in Programming - Full Course

Recursion in Programming - Full Course

FBTwitterReddit

video description

Rating: 4.0; Vote: 1
Recursion is a powerful technique that helps us bridge the gap between complex problems being solved with elegant code. Within this course, we will break down what recursion is, why you would and wouldn-t want to use it and look at a variety of examples for how it can be used. We-ll break down recursion with all sorts of data-structures, animations, debugging and call-stack analysis to get a deeper understanding to these principles. The code is written in Java, but the principles are agnostic to any language
Date: 2022-03-14

Comments and reviews: 10


First wants to thank you for this amazing video,
i am trying the example as it is from video. What I am doing wrong here?
// Merge Sort
public static void mergeSort(int[] data, int start, int end) -
if(start < end) -
int mid = (start + end) /2;
mergeSort(data, start , mid);
mergeSort(data, mid + 1, end);
merge(data, start, mid, end);
-
-
private static void merge(int[] data, int start, int mid, int end) -
// build temporary array to avaoid modifying original contents
int[] temp = new int[end - start + 1];
int i = start;
int j = mid +1;
int k = 0;
while (i

reply

You should delete this video and instead of recursion simply use a for loop with the number of slots of the call stack as the conditional part of the for loop. That way when the stack is finished processing the iterations stop. It is very unusual to actually use recursion. I think the last time I thought of it was when common lisp was a popular language.
reply

All these examples look super interesting, but I just want to point out that tail-call recursion optimization is super important to know, even though it-s kinda briefly mentioned here. Really sad that-s it-s mostly not supported in JS yet. Have a look at Elm if you want to safely use recursion in the browser :)
reply

Been coding since 1997: recursion is good for academic purposes but almost everytime I saw it in a product, it was a source of bugs due to usage of stack above limits, which limits are very difficult to guess. Each f call is on stack.
reply

Recursive:
re-kers-ive prefix re - repeated,
suffix - ive having the nature of
curse - to invoke the wrath of a deity or to express feelings with an expletive
example: -all my code is recursive when I'm debugging it.-

reply

Does anyone have JavaScript versions of the functions? I tried to do string reversal, palindromes, and number to binary and they all failed. I would like to see some working examples so that I can better understand recursion.
reply

Is it more common for engineers to think recursive algorithms are simpler to come up with it? For me, I find the iterative solution to be more intuitive.
reply

Totally agree with that -...seem like you're always going back to the beginning- and hopefully don't go back to the beginning after watch this. lol
reply

Hey everyone! -. I-m stoked to share some knowledge on recursion through FCC. Feel free to reach out or connect with me if you have questions!
reply

I think there's an error in check palindrome.. 26:00
While calling it should be 1 and input.length()-2...
Please clear my doubt

reply
Add a review, comment






Other channel videos