
Recursion in Programming - Full Course
video description
Date: 2022-03-14
Related videos
Comments and reviews: 10
Ankit
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
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
calmchess
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
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
Sylvain
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
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
Jean-Francois
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
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
Ferndalien
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
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
Jim
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
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
DW
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
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
Eva
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
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
Ryan
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
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
Amith
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
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















