It's very very difficult to understand you because you speak so so fast
@elicompton51226 жыл бұрын
In order to understand recursion, you must first understand recursion
@derekbanas6 жыл бұрын
That's funny :)
@anugrahgeorge82934 жыл бұрын
No. In order to to understand recursion, you must first understand recursion. In order to understand recursion, you must first understand recursion .In order to understand recursion, you must first understand recursion . In order to understand recursion, you must first understand recursion . . . . . . . Constant loop
@ExarchiasGhost4 жыл бұрын
@@anugrahgeorge8293 do you mean recursion?
@anugrahgeorge82934 жыл бұрын
@@ExarchiasGhost yes but in order to understand what u asked...U need to ask urself what is recursion. Then understand recursion. Then understand recursion. Then understand recursion. *bloody loop*
@ExarchiasGhost4 жыл бұрын
@@anugrahgeorge8293 ok but I will start from the recursion because when I tried with recursion I got results from a recursion. :)
@daniels682410 жыл бұрын
I spent 3 semesters in computer science courses avoiding recursion like the plague. I have had only excellent teachers, but never nailed down the nuances that kept recursion confusing. Here I am, at 4 am the night before my final and you absolutely nailed it (it was the going back up concept, among other things). Progressing in this field can be difficult, and I am very thankful for your tutorials. You must love what you do!
@derekbanas10 жыл бұрын
I absolutely love programming :) I'm very happy that I was able to clear up a very often confusing topic. That is always the goal of each video.
@yankomirov42905 жыл бұрын
Where are you working now, after 4 years?
@atift54655 жыл бұрын
This was an amazing explanation! Im right there with you!
@derekbanas11 жыл бұрын
Thank you :) Im very happy I was able to help. I worked as a programming architect for many years and one of my responsibilities was to train new hires. I always enjoyed doing that. While making these videos I imagine someone is standing behind me and learning. It makes me very happy to be able to help
@derekbanas11 жыл бұрын
I'm extremely grateful to be able to help in what ever way I can. Thankfully there are thousands of people that love to teach and that number will continue to grow. Eventually a complete education on every topic will be available for free to all across the globe.
@howchen85295 жыл бұрын
I spent so long on the first recursive function thinking he passed in 1.6
@whyisthereyou4 жыл бұрын
Omggg, I was trying to figure out too and how he went from 1.6 to 2.5 lol
@theelvensong43284 жыл бұрын
Me too :)
@keyseafloralde87954 жыл бұрын
Sameee hahah
@trendytopics-2 жыл бұрын
SAME
@derekbanas11 жыл бұрын
I have been programming for over 25 years. In the beginning I studied constantly, but now I pretty much have my system and I follow it. I write code for about 1/2 the day 7 days a week. I keep up on the new technologies, but I mainly still use Java, C, C++, PHP and JavaScript for everything. I am very lucky in that I can decide what projects I want to work on, so I'm always excited to program. I mainly write programs with a ton of math, or simulations
@yaanyfizzle9 жыл бұрын
I just watched 3 tutorials, got absolutely nowhere, and within the 1st 50 seconds of this video you explained it! Derek Banas > All
@derekbanas9 жыл бұрын
***** Thank you :) I'm happy I could help.
@yaanyfizzle9 жыл бұрын
Not as happy as I am mate. Thankyou 😌
@sandblaster0075 жыл бұрын
I know this video is from 2013 but I couldn't wrap my head around recursion at all until I watched this. I'm a freshman in college with a great teacher but she wasn't able to explain it this well. Thanks so much! :D
@derekbanas5 жыл бұрын
I'm very happy I could help :)
@justinli199010278 жыл бұрын
Need to concentrate extremely hard but very well explained.
@derekbanas8 жыл бұрын
+Justin Li Thank you :)
@hananeaf45087 жыл бұрын
Is it because of the accent? hehehe
@SoeaOu11 жыл бұрын
Thank You. I was so afraid of recursion and the fact that i couldn't come up myself how to do factorials using recursion, but when I saw the third example I made it myself, so easy :D I think this are the best intermidiate/advanced java tutorials on the internet.
@derekbanas11 жыл бұрын
I'm glad it helped :) I figured if I provided enough walkthroughs that it would make sense
@sebastianfarias56708 жыл бұрын
wow, every time I struggle with x/y concept there is a video in your channel that helps me understand it 100%... Again, thank you Derek!!!!!
@derekbanas8 жыл бұрын
Thank you for the compliment :) I'm happy I can help
@derekbanas11 жыл бұрын
I'm happy that I could clear it up. I don't know why so many people struggle with teaching this topic?
@123japanuser11 жыл бұрын
Caro Coach, La tendenza sarà in vita fino a quando si ottiene il tutorial grandi. Tu sei la ragione per la nostra capacità di migliori. Più potenza per voi. grazie
@derekbanas11 жыл бұрын
Well I'm very happy to help! I'm glad he likes his job at least :)
@derekbanas11 жыл бұрын
Thank you :) I try to make the best videos I can. I'm glad you liked it
@iNewbieNick9 жыл бұрын
This is my first year in college and I'm majoring in computer science. Our professor just tried to teach us about recursion but didn't do it very well and left the class thinking "WHAT JUST HAPPENED. WHY DID THAT WORK!?!?!", myself included. I've had an issue where I haven't been able to comment on videos for a year and was too lazy to fix it. This video was so helpful, and I'm so grateful, that I got off my lazy ass and figured out how to fix my problem just so I could comment on this video and thank you. Thank you for teaching me about this confusing concept!! You're the best!
@derekbanas9 жыл бұрын
iNewbieNick Thank you very much for all the nice compliments :) I appreciate you taking the time to tell me that I helped. You're very welcome.
@derekbanas11 жыл бұрын
Great! I'm glad I was able to make recursion make sense :)
@gadafiali915111 жыл бұрын
You just earned a comment, a subscription, and a fan.
@derekbanas11 жыл бұрын
Thank you :)
@derekbanas11 жыл бұрын
Pick projects that are fun. I only work on fun projects. When I was young and just starting with programming I made games and nothing else because games are fun to make. Games also require you to know many things. Don't try to memorize because that will just bore you. Instead come up with an idea, copy and paste others code and then just fix the errors. Once you get past the basics programming is very fun
@derekbanas11 жыл бұрын
Thank you very much :) It is hard to work through the first time, but after you get it it makes sense. I'm very happy that I've been able to help
@nicolaslondono71888 жыл бұрын
You are the god father of programming tutorials!
@derekbanas8 жыл бұрын
+Nicolas Mazorra Thank you for the nice compliment :)
@derekbanas11 жыл бұрын
I think I have a pretty intelligent community. Many of them stayed with me through design patterns and refactoring. If they can handle those topics recursion should be a breeze. You are right though that things can go crazy if they try to use the merge sort on a 10,000 item array :)
@derekbanas11 жыл бұрын
Thank you :) I have a mile long list of algorithms in the works
@YouB3anz10 жыл бұрын
I think it's worth mentioning that this implementation of merge sort, with in-place index shifting on an array, is O(n^2). Merge sort is usually taught using substructures and is O(nlg(n)).
@loganphillips16748 жыл бұрын
Wow thank you so much. My data structures text book didn't explain at all how this works. I ran an example in the debugger and was extremely confused why it went "back up" once it hit the base case. You cleared it up in the first 2 minutes. Thank you!
@derekbanas8 жыл бұрын
Thank you :) I'm glad I could help
@123japanuser11 жыл бұрын
Уважаемый тренер, Это мульти лингвизм становится серьезным :) Спасибо, еще раз, за все, что вы делаете.
@derekbanas11 жыл бұрын
I program with Eclipse Indigo. I record the screen with Camtasia 2. I edit everything with iMovie. My microphone is a simple iPod headphone mic.
@derekbanas11 жыл бұрын
I make custom applications for a small group of people. Mainly tools they use for investing. I also make apps for professors (research stuff). On top of that I run 8 online stores. Yes, it is great to be in a position to turn down business. For 4 years I had to take on every project and it sucked. I'll never put myself in that position again
@123japanuser11 жыл бұрын
Уважаемый тренер, Это мульти лингвизм становится серьезным :))) Спасибо, еще раз, за все, что вы делаете.
@derekbanas11 жыл бұрын
Absolutely you should go! I could have continued, but I was working to pay my way. I got a few scholarships and I refused to take out loans. That is the main reason it was hard for me. I also didn't like the speed and I didn't feel like I was learning everything. College just isn't for everyone, but if I could have afforded to go to a good school for free, or inexpensively I definitely would have gone
@WhoForgot2Flush6 жыл бұрын
I actually came here because I was trying to make a merge sort algorithm and wanted a better understanding of recursion before starting. Thanks for covering merge sort too very helpful.
@derekbanas6 жыл бұрын
Thank you :) I'm glad it heped
@lightbikevids142211 жыл бұрын
after watching the first example i understood it so well, my teacher spent a whole class on recursion understood nothing thanks
@redvel50427 жыл бұрын
Actually, for triangular numbers, you can calculate it like this: public int getTriNum(int num) { return (num + (num * (num - 1) / 2)); } Or a bit more understandably: public int getTriNum(int num) { for(int i = 1; i
@derekbanas7 жыл бұрын
Thank you for sharing :) I was just looking for an excuse to use recursion
@veebuv9 жыл бұрын
fantastic, got it in one go. Perfectly paced.
@derekbanas9 жыл бұрын
Vaibhav Namburi Thank you :)
@derekbanas11 жыл бұрын
Grazie per le gentili parole. Io continuerò a fare del mio meglio
@derekbanas11 жыл бұрын
Because if you have num + method(num-1) and if num = 1, then 1 + (1-1) = 1.
@user974111 жыл бұрын
wow, you're first example was all I needed to break the barrier. Thanks!
@thecomempire10 жыл бұрын
Hi Derik- I just wanted to say thank you for all your fantastic videos- they have really assisted me in my studies! No need to sit and read the textbook anymore!
@derekbanas10 жыл бұрын
Hi, I'm very happy to hear that I could help. You're very welcome :)
@derekbanas11 жыл бұрын
It is actually pretty easy after a while. Is it worth it? That depends on what you mean by worth I guess :) I very much enjoy helping people and most people are extremely nice.
@derekbanas11 жыл бұрын
Thank you very much :) Your teacher probably just doesn't like his job. I think the worst thing in the world is being forced to work in a job that one dislikes. I'll do my best to fill in the gaps that your teacher misses
@tpr_iv8 жыл бұрын
You are awesome dude. Thank you so much for doing these. I'm starting to realize the necessity for self-teaching in the computer science major, and these help loads.
@derekbanas8 жыл бұрын
+Tom Reilly Thank you :) I'm happy I could help
@derekbanas11 жыл бұрын
I've used pretty much every language at one point or another.
@bigshaqsmathematicalinstit33184 жыл бұрын
Just simply amazing. I believe college professors are experts in their fields of study, but some are not cut out to be a educator.
@derekbanas4 жыл бұрын
Thank you :) I'm happy I could help
@mezcop4129 жыл бұрын
Has anybody else covered Java as well as you have? I remember watching one of your videos at the end of 2013 (for easy code involving HTML / CSS, and so on). I'm becoming obsessed with code and I want everything out of it.
@derekbanas9 жыл бұрын
Mez Cop Thank you for the nice compliment :) I guess I have the most popular Java videos. I'm very proud of that!
@seemsas11 жыл бұрын
Thanks Derek, for one more illustrative tutorial! Before, I only had a kind of vague idea of recursion but now, I believe to understand it better. I'm looking forward to the sorting methods...
@danisburner22498 жыл бұрын
Just so you know the dashes confused me really bad as I thought they were minus signs
@derekbanas8 жыл бұрын
+Dan En Sorry about that
@paulodeleon17154 жыл бұрын
You earned another subscriber! Thank you so much! In only just 2 mins i did understand it more than my purchased course in Udemy! Thank you very much!
@derekbanas4 жыл бұрын
Thank you very much :) Happy I could help
@derekbanas11 жыл бұрын
Thank you very much :) Ill be making java related tutorials for quite a bit longer. I hope you enjoy them
@Jpgmeg8 жыл бұрын
Very impressed with the quality of these videos! I'm a software engineering student, and these videos are great helpers!
@derekbanas8 жыл бұрын
+Megan Doherty Thank you :) I'm happy that you like them.
@derekbanas11 жыл бұрын
That will be covered after my next video on the shell and quick sort :)
@jimbotime1236 жыл бұрын
0:00 - 2:04, Explained it better than every other video
@KETANRAMTEKE7 жыл бұрын
Derek thank you so much. KZbin is awesome because of the content creators likes you.
@derekbanas7 жыл бұрын
Thank you for the nice compliment :)
@paratek_io9 жыл бұрын
I learn more from these videos than I do in my Uni courses. Thanks!
@derekbanas9 жыл бұрын
JackRabbit Thank you :) I'm happy I could help.
@kereshannaidoo26269 жыл бұрын
same for me lol
@derekbanas11 жыл бұрын
Thank you :) it is very gratifying to help people
@MegaGangsta4life10 жыл бұрын
I have a quiz tommorrow in APCS thx for the help xD
@derekbanas10 жыл бұрын
You're very welcome :) Good luck on your test.
@MegaGangsta4life10 жыл бұрын
I failed the test btw xD
@derekbanas10 жыл бұрын
MegaGangsta4life I'm sorry to hear that. I always considered failing to be a good thing though because I then focus and move on. Keep at it and you'll do fine. If I can do this stuff so can you. I wish you all the best :)
@MegaGangsta4life10 жыл бұрын
Derek Banas I am an indie game developer, and I program a lot, I took AP Comp Sci because I thought it would help me. I was wrong xD I fail all the test and copy/paste other people`s code just to get a B in the class :P I enjoy programming and Ive made 3 games, I just despise my class. But your tutorials do help a lot
@derekbanas10 жыл бұрын
MegaGangsta4life Keep at it. When the student fails it isn't the fault of the student it is the fault of the teacher. Never let the failings of others define you. For some reason in this day in age teachers believe their job is to force students to fail. I think that is lazy. I see no reason to idolize lazy people either :) Only through failure do we appreciate success. The only people that deserve success are those who struggle to find it.
@derekbanas11 жыл бұрын
Thank you :) That is very kind.
@crazypigs1009 жыл бұрын
Thankyou for posting this! My lecture did not explain this well haha. Hopefully I can one day be able to make videos and help others!
@derekbanas9 жыл бұрын
crazypigs100 You're very welcome :) I'm glad I could help
@claremacdonald73588 жыл бұрын
you sound like andy from the office and i love it
@derekbanas8 жыл бұрын
+Clare MacDonald Thank you :) I hear that all of the time
@newmagicfilms7 жыл бұрын
Why we need recursion if we have "while" or "if" ? Can you explain?
@derekbanas7 жыл бұрын
In certain situations recursion makes for dramatically shorter and actually easier to understand code. One common use is with web crawlers. You go to the site and find all the links. You then follow all those links to other completely different pages. This continues forever until you finally come to the end of the line and cycle back to the original page. This would be impossible to do with normal looping, but recursively it is quite straight forward.
@NusaybaMoft10 жыл бұрын
u go way too fast :/
@lordspotato50324 жыл бұрын
@@_________________404 LOL Liao was talking about her reply to the comment
@theelvensong43284 жыл бұрын
If it goes too fast, you can pause the video and/or go back. Also, watching other videos on related topics like triangular numbers, etc, can help. I do the same.
@anthonyani16315 жыл бұрын
I said to myself 'I wish I could double like' . Very nice video! You just got a new follower
@derekbanas5 жыл бұрын
Thank you very much :)
@derekbanas11 жыл бұрын
I'll see how soon I can cover that
@CC-bm3wb6 жыл бұрын
You sound like Andy Bernard from the Office. Also, thanks for the video explaining recursion, this makes a lot more sense to me seeing what happens at each step :)
@derekbanas6 жыл бұрын
I'm happy it helped :) I get compared to Nard Dog all the time
@NeverMyRealName11 жыл бұрын
you are awesome man. you're videos helped me re-learn these basic programming concepts! keep it up.
@derekbanas11 жыл бұрын
Yes that would be another candidate for recursion :)
@blockbusterlatefees77135 жыл бұрын
I'm watching this once every day until it's burnt into my brain.
@derekbanas5 жыл бұрын
I hope it helps :)
@derekbanas11 жыл бұрын
You're very welcome :) Thank you
@MegaVuhung11 жыл бұрын
That's really encourage me to keep on coding (must admit that it's really boring sometimes) Thks anyway!
@derekbanas11 жыл бұрын
I used to be able to speak German and could read and write Chinese and Japanese, but I've since forgotten most of it
@coolstuffinlocker7 жыл бұрын
I wish I could explain stuff like this guy does.
@derekbanas7 жыл бұрын
Thanks for the compliment :)
@brunomalmsteen9 жыл бұрын
Hey Derek, how are you doing? Is is possible to change your code to implement towers of Hanoi and build a trace just like the ones you did for factorial and triangular number? By the way, one of the best videos on this subject available ;)
@MegaVuhung11 жыл бұрын
U r really excellent at coding so Can u tell me how much time do u spend to learn or writing code( or sth like that) a day?
@matthewsagen72438 жыл бұрын
Great video, it moved a little fast for me, once you got into triangular numbers.
@derekbanas8 жыл бұрын
+Matthew Sagen Thank you :) Sorry about the speed
@azokennedy207 жыл бұрын
Thanks again Derek. Much clearer now.
@derekbanas7 жыл бұрын
Great I'm glad it helped :)
@ruimenghu944711 жыл бұрын
these is my dream lecture, Thanks for your patient help.
@yourface13able5 жыл бұрын
I wish I found this guy at the beginning of my semester
@derekbanas11 жыл бұрын
Mimi najua lugha ya programu nyingi lakini wachache sana zinazozungumzwa. Mimi kamwe kuongea na watu katika ulimwengu halisi hivyo mimi kidogo kutumia kwa ajili yao :)
@shilpinator11 жыл бұрын
Thanks for the help. Its unfortunate that after paying thousands of dollars of tuition to universities, they can only provide us with professors who are incapable of teaching, and we have to come to places like KZbin and hope that there are better instructors out there willing to help us out for 'free'.
@blackfay04 жыл бұрын
Thanks! It has helped me understand the devilish recursion.
@derekbanas11 жыл бұрын
Вы начали тенденция :) Вы очень приветствуются. Я делаю видео как можно быстрее. К сожалению она так долго
@123japanuser11 жыл бұрын
Hallo liebe Trainer, Das ist eine schwierige Thema zu lernen. Dank Ihnen wird es nicht ein Problem in der Zukunft sein. Ich bin froh, wieder Gold zu gewinnen :) :) Ich bin der aredent Schüler von Ihnen. vielen Dank
@anjulishukla11897 жыл бұрын
can u tell me how to sum a fibonacci series by recursion only in java... please
@prasoonpandey11847 жыл бұрын
Thanks sir. The explanation of the recursive methods was very good and it made it easier for me to understand that. Though, the later portion of the video was too complicated for me. Thank you for the video. I guess I will also use the same way as you to teach my viewers about recursion. Cheers 👏
@derekbanas7 жыл бұрын
I'm very happy that it helped :)
@prasoonpandey11847 жыл бұрын
😄
@alkhirgoodness11 жыл бұрын
This is just terific . Please continue doing this great job My besr wishes
@ankurpaliwal97135 жыл бұрын
nice explanation Can you also create a tutorial on using recursion in trees where recusrion is used more than once in a method?
@derekbanas5 жыл бұрын
Thank you :) I'll see what I can do
@John-shreds7 жыл бұрын
Awsome, but these examples all had a base case of one. Could you do an extra video for recursion problems with more than one base case? Also, could you cover recursive permutation as well? Where you can print out every possible combinations for letters in a word?
@derekbanas7 жыл бұрын
I'll see what I can do
@John-shreds7 жыл бұрын
sweet!
@roul36886 жыл бұрын
A little fast for me but thanks for the video. Glad I have a pause button
@derekbanas6 жыл бұрын
I'm glad it helped :)
@PuneethBedre11 жыл бұрын
this helped to some extent, but im unable to apply myself in order to trace the recursion algorithm for Towers Of Henoi. It'd be nice to have you explain that.
@youtubeaccount0x0735 жыл бұрын
It would help me so much if you did a real life example with out using factorials and triangular numbers
@aliwally13232 жыл бұрын
In the box model representation of the first problem (getTriNum) , wouldn't the return of the call getTriNum(1) simply yield the result of 1 rather than the result of the computation of 1 + getTriNum(1 - 1) since the method checks to see if n is equal to 1. If n == 1, there is no recursive call made, the method just returns 1.
@Simon_Alexnder3 жыл бұрын
Its time for another "Good Idea / Bad Idea" Good Idea: using Recursion with stopping condition; Bad Idea: Bad Idea: exception stackoverflow;
@jamessoul32215 жыл бұрын
Hey Derek, Just a question: in your method printHorzArray, why are the first two integers being passed into the first two parameters -1? Thanks in advanced.
@circuitfreak2411 жыл бұрын
Great tutorial! I hope you'll cover Dijkstra's algorithm in the upcoming videos :)
@mayachandra37349 жыл бұрын
How do you talk so damn fast?
@jackdewipper1876 жыл бұрын
goes way too fast for a beginner
@nathantaal966 жыл бұрын
Crypto Amirates Watch at 0.75
@romerome88925 жыл бұрын
It's fine because it's a video and u can rewind any time.
@mylifeassaifi17088 жыл бұрын
Thanks ....your voice is so catchy .
@derekbanas8 жыл бұрын
Thank you for the compliment :)
@coolio48439 жыл бұрын
Love your videos! Just have one question involving strings in recursion. When you do the substring of a word do you add it all together? Let's say it's x + f(x.substring(4)). Would you add the word to the substring? Sorry if that's confusing thanks!
@flowersunny7195 жыл бұрын
Hi Derek, I think the first two "int" arguments in the "printHorzArray" method are not necessary. Could you explain why you put them there? I think you must have some good reasons for that.
@dwc5009 жыл бұрын
how would you call a recursion function that returns the number of zero digits in the non-negative number that someone entered?
@ssj4rit8 жыл бұрын
Do something like converting the number parameter to a string. Then use two conditionals. If the first character is not 0, call the function with the parameter as the number string without the first digit. Else, return 1+ function without the first digit in the string. Remember to cast this string back to an int. Your base case should probably take into consideration if number
@AroundWayOther9 жыл бұрын
Hi Derek, do you have any videos on recursive backtracing? If not, where can I look to learn about it?
@derekbanas9 жыл бұрын
BKexplorer Here is a nice example www.dreamincode.net/forums/topic/258287-a-look-at-backtracking/