Solving Programming Problems

Поделиться
HTML-код
  • Опубликовано: 17 окт 2024
  • Ge the Code Here: goo.gl/R6R1F
    To finish off my Java Algorithm tutorial, I thought it would be interesting to cover solving programming problems in general. So, in this tutorial I'll answer the question I've been getting, which is how to print a tree data structure.
    On our journey to better understand how to solve problems I will first solve the basic problem. Then in the next part of the tutorial I will perfect printing any type of tree. The code above will better explain the process of solving this problem.

Комментарии • 229

  • @derekbanas
    @derekbanas  11 лет назад +1

    I'm sorry I don't understand the question. Post any questions that you have and I'll try to help

  • @jmoney1139
    @jmoney1139 7 лет назад +29

    This video was so worth it just to learn the wolfram alpha trick if nothing else lol, so glad I found out about that now. I can see it save me much time in the future

    • @derekbanas
      @derekbanas  7 лет назад +5

      Thank you :) I'm glad it helped

  • @derekbanas
    @derekbanas  11 лет назад

    I do my best to make the process useful for all oop languages. What language are you using?

  • @Aaron-sy5yx
    @Aaron-sy5yx 5 лет назад +55

    "I'm going to pretend I don't know anything about math". Proceeds to fetch some complicated formula. Bruh

  • @derekbanas
    @derekbanas  11 лет назад +1

    I was demonstrating a way to make calculations of nearly any form. It wasn't meant to be optimized, but instead easy to do with little thought. Sorry I didn't explain that better

  • @derekbanas
    @derekbanas  11 лет назад

    I'd love to do a tutorial series on how to solve problems. I don't think there is even a book on the process? The next video will work through the process of making this code even better using simple logic as well

  • @derekbanas
    @derekbanas  11 лет назад

    Check out my object oriented design and uml tutorial. They'll provide most everything you need. Soon I'll be making very large programs that will demonstrate the process further

  • @derekbanas
    @derekbanas  11 лет назад

    I start every large project and most small ones with uml diagrams. Anything can be solved if you break everything down into a small series of steps. I worked on QuickTime forever and a day ago. We solved everything in uml. The code is easy after that is finished

  • @luisriba8082
    @luisriba8082 9 лет назад +7

    I don't know how you code so fast and make it perfect. My respect. I really want to get that good at it. Sir.

    • @derekbanas
      @derekbanas  9 лет назад +5

      Luis Riba Keep practicing. I'm actually writing code from a sequence diagram. I have tutorials on how to create them. it makes life very easy.

  • @derekbanas
    @derekbanas  11 лет назад +1

    Thank you :) You're very kind for saying that! Ill continue to try and do my best.

  • @derekbanas
    @derekbanas  11 лет назад

    It will start around Thursday. I have just one more algorithm tutorial for now on heaps

  • @derekbanas
    @derekbanas  11 лет назад

    Yes great point. I was trying to teach how to solve problems in a structured way no matter how hard the problem is. I actually did some of the math for trees in the beginning of this tutorial, but I decided not to use it to help.

    • @anonymous-zf1qm
      @anonymous-zf1qm 4 года назад

      Hi!! Is this problem similar to the problem that software engineer solves?

  • @sachdevacreations7574
    @sachdevacreations7574 7 лет назад +4

    You can do 7,3,1,0 by dividing each next number by 2 as c compiler doesnt print the number after decimal.

  • @robinzclark
    @robinzclark 5 лет назад

    You are my hero. This is one of the very best videos I've ever watched. So clear and simple. I would like to see more videos like this for different problems. There are some codility and code wars problems that I did not understand how people arrived at the solutions. Specifically the genomic range query on codility problem I can not understand a simple solution after almost a week of study. Another problem I have struggled with the past week is the supermarket queue problem on codewars.

    • @derekbanas
      @derekbanas  5 лет назад

      Thank you very much :) I'll see what I can do about your requests

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you very much :) I do my best to cover everything in my tutorials. I'm glad you liked it

  • @GeloEd
    @GeloEd 8 лет назад +9

    This one is my favorite of your java tutorials.

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) Yes, it is kind of a hard topic to teach. It is quite hard to teach people how to think

  • @drkcaey
    @drkcaey 11 лет назад

    Hi, I'm preparing for senior year next year and I have a question that might be irreverent to this tutorial. If I were to go into the programming career, will I be earning as much as other computer network engineers? (In the sense of average.)

  • @123japanuser
    @123japanuser 11 лет назад

    Pozdrav Dragi trener,
    Ona je postala tako uobičajena za mene očekivati ​​video dan.
    Ja sam tako sretan da biste dobili još jednu :))
    Najpredaniji izgubio zlato za 15 minuta.
    Možda moram reći osvojio srebro.
    Sretan dobiti na pobjedničkom postolju.
    Pazite i hvala za sve što činite.

  • @niksen3300
    @niksen3300 8 лет назад +4

    Which chapter of math should i look into to figure how to create my own algorithm for series like that?
    What other chapters do you usually find yourself in need to accomplish some problem solution?
    Thanks for the awsome content

    • @derekbanas
      @derekbanas  8 лет назад +6

      Discrete mathematics probably helps best for programmers

  • @hennabuzzz8687
    @hennabuzzz8687 3 года назад

    Complex to simple
    Great explanation with the actual flow of the transformation of code (from words)

  • @watcbd
    @watcbd 11 лет назад

    At this point I just click LIKE before I even start the video. Thanks Derek Banas!

  • @derekbanas
    @derekbanas  11 лет назад +1

    Thank you :) I try to do my best and improve from video to video

  • @JoshT4life
    @JoshT4life 5 лет назад

    I'm sorry new to the channel but how do we know what to fetch here? I'm trying to learn how to solve for algorithms and problems but going to a website and knowing what to fetch doesn't sound like the solution

    • @derekbanas
      @derekbanas  5 лет назад

      I'm trying to show interesting ways that you can solve problems in this tutorial. Most every programmer has tricks they use to solve problems and I'm passing a few on in this series of videos.

  • @axman1000
    @axman1000 11 лет назад

    Also, to have an advanced tutorial, where you show these data structures the way they are implemented in Java - like how Hash Maps, Trees and other data structures have Java implementations. You could probably do one on each and explain each of the methods associated with the structures. Just a thought.

  • @derekbanas
    @derekbanas  11 лет назад +1

    I'll do my best to fit it in. I have literally hundreds of requests I'm doing my best to get done. Android is next and it will start next week at the latest

  • @guru3750
    @guru3750 7 лет назад

    Derek, thanks again for making a great tutorial! One question: in programming competitions, i.e, the Informatics Olympiad, we do not have access to Wolfram Alpha. Are there any fast ways of calculating or designing an algorithm? Are there any resources you can refer me to? Thanks!
    EDIT: I saw this course by MIT on Discrete Maths: ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-042j-mathematics-for-computer-science-spring-2015/ . However, I've not done calculus, trig, or Algebra 2 (only Algebra 1), so what's your take on it?

    • @derekbanas
      @derekbanas  7 лет назад

      Thank you :) Discrete mathematics is basically the most important form of mathematics for programmers, so definitely check that out. I used Wolfram Alpha just to help people that may not be gifted in math. The only way to get good at math and designing algorithms is to practice and to read about algorithms others have made.

  • @derekbanas
    @derekbanas  11 лет назад +1

    VB is pretty much an OOP language. I wish I could go into programming with it, but I'm a little overwhelmed by other tutorials right now

  • @derekbanas
    @derekbanas  11 лет назад

    It's pretty neat :) I use it all of the time when I don't want to think

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) It is starting in a few days. I'll do my best

  • @derekbanas
    @derekbanas  11 лет назад

    Here is my UML tutorial if that helps ruclips.net/video/OkC7HKtiZC0/видео.html

  • @derekbanas
    @derekbanas  11 лет назад

    I have that topic on the list. I plan on covering C++ soon. I think I may make it while I make android tutorials

  • @sydethsam
    @sydethsam 11 лет назад

    This is a really good tutorial. I cannot wait for your next one that relate to this one.

  • @theamjolnir9641
    @theamjolnir9641 6 лет назад

    If you don't use wolfram alpha how would you approach this problem?

  • @woulfe42
    @woulfe42 4 года назад +1

    I understand his logic and steps he took, he made it look easy but, perhaps this os not the best way to begin as a beginner this is usually for someone that is novice perhaps.

  • @derekbanas
    @derekbanas  11 лет назад

    Those tutorials are in the works and will be coming soon

  • @SaintMartini2008
    @SaintMartini2008 7 лет назад

    HEY! What is that website that you used to find the calculation? What is the main purpose of that site? Thank u!

    • @derekbanas
      @derekbanas  7 лет назад

      I was just showing a trick for people that aren't gifted in math. www.wolframalpha.com/

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you very much :) I do my best to make the videos interesting

  • @shhagley
    @shhagley 5 лет назад

    Thank you for this,simple way to solve problem, english to math to code

  • @Shaggy12321
    @Shaggy12321 6 лет назад

    I have a degree in computer science and I didn't understand a bit of this, how did that random calculation help?

    • @techno-trickster636
      @techno-trickster636 6 лет назад

      ruclips.net/video/3No1Eidsx98/видео.html
      use this tutorial for built your concept,it's really helpful

  • @blognewb
    @blognewb 11 лет назад

    This is so so important. Thank you sir, please expound more on this, planning/ uml design on programming

  • @blognewb
    @blognewb 11 лет назад

    I think a video series on "Best Practices in programming" would be great.. like per language too.. best practices in php etc, is that good?

  • @yoshi656
    @yoshi656 7 лет назад

    Thank you for the tutorial.
    Where can I find the custom implementation of the Heap class (having the percolate() method)?
    Later Edit: I found it around minute 9:37 but it's missing the generateFilledArray() method.

  • @Mireda-wr3yc
    @Mireda-wr3yc 10 лет назад

    please , could you tell me , how i solve a problem that i have , i used repaint() function,,, and i want my paint to stay in the panel when i resize my frame because it's disapear when i resize the frame :(

    • @TheUnofficialGamer22
      @TheUnofficialGamer22 10 лет назад

      It would be draw(); instead of repaint(); if you want to keep previous things on screen

    • @techno-trickster636
      @techno-trickster636 6 лет назад

      ruclips.net/video/3No1Eidsx98/видео.html
      Use this complete tutorial to build your concept in Java algorithm.

  • @derekbanas
    @derekbanas  11 лет назад

    That is a very big answer. I will cover math in the future. I have big plans

  • @danieltiotuico2487
    @danieltiotuico2487 9 лет назад

    Sir, do you have a tutorial that would cover c#? or better that would help me out in passing MCSD exam [70-483] ?

    • @derekbanas
      @derekbanas  9 лет назад

      +Daniel Tiotuico I cover C# in one video here ruclips.net/video/lisiwUZJXqQ/видео.html

  • @derekbanas
    @derekbanas  11 лет назад

    I'm glad you liked it :)

  • @shrimpboyho
    @shrimpboyho 11 лет назад

    Derek you should really do a learn git in 30 minutes tutorial, similar to your learn JavaScript in 30 minutes tutorial. I think it would help a lot of budding developers. And I was wondering if you had any plans to do some C++ tutorials similar to these data structures tutorials.

  • @salarali6124
    @salarali6124 6 лет назад

    Programming is difficult but it can be easier if we take interest in computer. I at first lost hope that i cannot learn programming but my father gave me hope and I with my dad support, learning programming.

    • @derekbanas
      @derekbanas  6 лет назад

      If I can learn to program anyone can. It is awesome that your Dad is helping :)

    • @salarali6124
      @salarali6124 6 лет назад

      Thx and u are right.
      We all are humans

    • @salarali6124
      @salarali6124 6 лет назад

      Derek Banas i am launching a youtube channel soon and i am hundred percent sure i will get more than 10M view per video. I offer you to join.

  • @akbaralam8683
    @akbaralam8683 8 лет назад +2

    this is the best lesson by far i have seen in YT . thanks a lot man

  • @hier0phant336
    @hier0phant336 11 лет назад +2

    Thanks, it's really good to focus on the "how" not the what all the time. :)

    • @derekbanas
      @derekbanas  11 лет назад +1

      I'm glad you found it useful and I definitely agree :)

  • @manos6972
    @manos6972 6 лет назад

    how to solve this problem pls help me, java.sql.SQLException: Access denied for user 'root'@'localhost' (using password: YES). i have only mysql command line client

  • @circuitfreak24
    @circuitfreak24 11 лет назад

    best programming tutorial in youtube :)

  • @jemsbond4671
    @jemsbond4671 9 лет назад

    hlw sir actually I am totally confused to learn about java, which part i initiate in java

    • @derekbanas
      @derekbanas  9 лет назад

      +Jems Bond Here is my Java video tutorial ruclips.net/video/TBWX97e1E9g/видео.html

    • @techno-trickster636
      @techno-trickster636 6 лет назад

      ruclips.net/video/3No1Eidsx98/видео.html
      Use this complete tutorial to build your concept in Java algorithm.

  • @sbasalan
    @sbasalan 11 лет назад

    Thanks a lot for providing UML serious link

  • @Truthiness231
    @Truthiness231 11 лет назад

    I actually never thought about using Wolfram Alpha in that way... yet something else I've been doing manually that computers could have been doing for me for years now...

  • @derekbanas
    @derekbanas  11 лет назад

    Yes -2^-1 is correct

  • @DrStrangeLove2050
    @DrStrangeLove2050 11 лет назад

    How did Wolfram Alpha get those formulae?? What method did they use??

  • @omerufuk
    @omerufuk 10 лет назад

    So good! only lack is that the name of the video. hard to find this video by searching on google or on youtube...

  • @arthurmee
    @arthurmee 11 лет назад

    Android . . . . excellent Derek. Looking forward to it. Thanks.

  • @anjaliagrawal9587
    @anjaliagrawal9587 6 лет назад

    I have a problem. I am not able to write solution for hackerranks questions. Help

    • @techno-trickster636
      @techno-trickster636 6 лет назад

      ruclips.net/video/3No1Eidsx98/видео.html
      Use this complete tutorial to build your concept in Java algorithm.

  • @KruszonTv
    @KruszonTv 11 лет назад

    If i may suggest, Spring/Spring MVC tutorials i would love to watch

  • @derekbanas
    @derekbanas  11 лет назад +1

    You're very welcome :)

  • @sbasalan
    @sbasalan 11 лет назад

    I must a good start somewhere of UML but your tutorials related with Java. It might makes me a lil confuse

  • @Memo-windowsBlogspot
    @Memo-windowsBlogspot 6 лет назад

    what is the best program for c++ in win 10

    • @derekbanas
      @derekbanas  6 лет назад

      I like NetBeans. I show how to set it up here ruclips.net/video/DamuE8TM3xo/видео.html

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) Android should out by next Thursday

  • @pranavpawar7792
    @pranavpawar7792 8 лет назад

    Thanks Thanks a lot Sir!!!! you are really the greatest teacher at least for me..... once again thanks

    • @derekbanas
      @derekbanas  8 лет назад

      +pranav pawar Thank you :) You're very welcome

  • @moofymoo
    @moofymoo 8 лет назад +4

    1:04 - I don't see how this will help to solve NP-hard problem.

  • @ibiixie
    @ibiixie 8 лет назад

    Does this apply to all programming languages? :P

    • @derekbanas
      @derekbanas  8 лет назад +1

      +BiiXteR Gaming Yes pretty much

    • @ibiixie
      @ibiixie 8 лет назад

      Derek Banas Alright :)

  • @ashvedlochun8240
    @ashvedlochun8240 9 лет назад

    Derek how do you get so good to think like this to solve problem??

    • @derekbanas
      @derekbanas  9 лет назад +3

      +Ashved Lochun Study my object oriented design, design patterns, algorithm and refactoring tutorials. Then write lot of code.

    • @ashvedlochun8240
      @ashvedlochun8240 9 лет назад

      +Derek Banas THanks Derek God bless you (Y) In fact im a bit poor in Java ANd c++ and i hoping your tutorials help me out greatly

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) I try to do my best

  • @axman1000
    @axman1000 11 лет назад

    Hi Derek, how about doing a tutorial on the newer technologies like Hadoop, HBase, Hive etc? Would really increase your visibility and of course, your fan base! :)

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) It was fun to make

  • @derekbanas
    @derekbanas  11 лет назад +1

    Thank you :) You're very welcome

  • @derekbanas
    @derekbanas  11 лет назад

    Salaries for programmers differ greatly even for pretty much the same job. I know one guy who makes $40k and another that makes $120k for exactly the same job. Depending on where you live also makes a major difference. I'm sorry, but that is a question that I can't answer

  • @younus6133
    @younus6133 8 лет назад

    Hey,your tutorials are awesome,can you give any link to learn algorithms which helps me in speed programming competition . Thanx :)

    • @derekbanas
      @derekbanas  8 лет назад +1

      Thank you very much :) Here is my algorithms tutorial ruclips.net/video/f5OD9CKrZEw/видео.html

  • @abdelsid1575
    @abdelsid1575 6 лет назад +2

    do u have minecraft that green block

  • @sbasalan
    @sbasalan 11 лет назад

    I got some documents about UML and I will study some this weekend. Hope you start VB.net sooner

  • @derekbanas
    @derekbanas  11 лет назад +1

    I always try to get computers to do all my thinking for me :)

  • @mariahacacia9480
    @mariahacacia9480 7 лет назад

    Do you have something similar but in Ruby?

    • @derekbanas
      @derekbanas  7 лет назад

      I have a Ruby tutorial ruclips.net/video/Dji9ALCgfpM/видео.html

    • @mariahacacia9480
      @mariahacacia9480 7 лет назад

      Ok, no worries. I had already watched that one and still having trouble solving these types of problems with Ruby. Thanks for the reply!

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you for the ideas :) Ill see what I can come up with

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) It will be up tomorrow

  • @derekbanas
    @derekbanas  11 лет назад

    Thank you :) I try my best

  • @DevoAjit
    @DevoAjit 9 лет назад +1

    great tutorial, gave a lot of ideas to me. thank you so much. :)

    • @derekbanas
      @derekbanas  9 лет назад

      Ajit Gupta Thank you :) I'm glad it helped.

  • @nabeelrajabali2172
    @nabeelrajabali2172 6 лет назад

    why does iteration have to start at 1? A trees iteration should start at 0.

  • @derekbanas
    @derekbanas  11 лет назад

    Something generic?

  • @RedEyedJedi
    @RedEyedJedi 7 лет назад

    Excellent tutorial as always and thank you for the wolfram alpha site. What an amazingly useful site :)

    • @derekbanas
      @derekbanas  7 лет назад +1

      Thank you :) I'm glad you found that tip useful

  • @ShamrockBones0804
    @ShamrockBones0804 11 лет назад

    When comes the annotations tutorial?

  • @DrStrangeLove2050
    @DrStrangeLove2050 11 лет назад

    04:48 Your mistake - it's negative power -n !
    I evaluated your wrong expression at n=1 and got really confused... (i got 28 instead of 7)

  • @kennyhendricks4293
    @kennyhendricks4293 7 лет назад

    This awesome Derek, You make me wanna play more with Haskell lol

  • @preetindersingh3396
    @preetindersingh3396 10 лет назад

    What about IPO Input, output, processing and data

  • @Salamaleikum80
    @Salamaleikum80 6 лет назад

    Why did you choose -2^(-n) (-16 + 2^n). I mean if i would try to solve it I wouldn't know which one to choose on wolframalpha.

    • @mnp1093
      @mnp1093 6 лет назад

      You just put in what output do you want. Like in the video: He needed 7,3,1,0. You cant sit down and manually design a series that would give you the output as 7,3,1,0. So you enter the output on Wolfram Alpha and it will create the formula for you, so you don't really have to know HOW to create the formula for the series. you just know that you have to use that one to get your desired output. Does that make sense?

    • @Salamaleikum80
      @Salamaleikum80 6 лет назад

      Im asking why he picked that formular and not the others that were shown on the site.

    • @mnp1093
      @mnp1093 6 лет назад +1

      The other isn't formulae. They are things like mean, total, vector length and so on. Only the last one is a series formula.Try it on wolfram alpha and go thru the entire page, you will get more clarity on it.

    • @Salamaleikum80
      @Salamaleikum80 6 лет назад +1

      oh now i get it thank you very much

  • @derekbanas
    @derekbanas  11 лет назад

    You're welcome :)

  • @vedicWayOfLiving
    @vedicWayOfLiving 6 лет назад

    Wonderful Teacher....

  • @vishnupriyan987
    @vishnupriyan987 5 лет назад

    Really I like your wolfram alpha trick

  • @mehrinisokamalova3327
    @mehrinisokamalova3327 6 лет назад

    Firstfull thanks for your tutorials. Its absolutely helps to learn programming and I really enjoy it. For this video, I'm a bit confused why did you calculate maxIndexPerRow. Can you explain it a little more.

    • @derekbanas
      @derekbanas  6 лет назад

      Sorry, but i don't see that in the code

    • @mehrinisokamalova3327
      @mehrinisokamalova3327 6 лет назад

      12:46min, 104th line of code: maxIndexToPrint = indexToPrint+itemsPerRow

    • @derekbanas
      @derekbanas  6 лет назад

      That tells me what index number I need to print up for each row of the tree

  • @sirtien
    @sirtien 11 лет назад

    Nice work as usual!

  • @fennecinspace
    @fennecinspace 5 лет назад +1

    this video is more complicated than it needs to be ...

  • @corradi3
    @corradi3 11 лет назад

    Why use such complicated formula for indent.
    indent = (int) (indent / 2.0); //eg: indent = 7. 7/2 = 3.5. (int) 3.5 = 3.

  • @sbasalan
    @sbasalan 11 лет назад

    I need to start a huge project in the company to develop a new software from ground.. Seriously, we need that but how can start? I dont have good enough knowledge to do that :( Bu I want that so much