Node-Based Data Structures in Java

แชร์
ฝัง
  • เผยแพร่เมื่อ 18 พ.ย. 2024

ความคิดเห็น • 143

  • @NERDfirst
    @NERDfirst  ปีที่แล้ว

    *On Debugging and Help*
    Unfortunately due to high IRL workloads, I'm not able to look at your code and help diagnose problems. You may contact me at hello(at)nerdfirst(dot)net for paid consultation, if you really see the need.

  • @MrDoctorSchultz
    @MrDoctorSchultz 4 ปีที่แล้ว +3

    The way you talk in plain English without using fancy terms or going too fast really makes this video easy to follow

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      Hello and thank you very much for your comment! Really glad to hear that the video was useful for you =)

  • @caliprogrammer3456
    @caliprogrammer3456 6 ปีที่แล้ว +40

    Wow instructors really need to understand this is how you explain new information to people. Even though I got a B+ in data structures I never really understood how the Node variable worked until now.

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +3

      Hello and thank you very much for your comment! Really glad to be of help :)
      It's unfortunate that sometimes schools don't have the time to go into this sort of step-by-step detail. Sometimes they're the missing link that allows everything to click!

    • @caliprogrammer3456
      @caliprogrammer3456 6 ปีที่แล้ว +1

      0612 TV w/ NERDfirst Many times I feel like it’s just these teachers have so much experience that they skip explaining small crucial steps because it’s so basic and easy for them they think everyone else knows it as well.
      Anyways Great videos so far, and if you do take video request, can you make any videos on data mining?

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +1

      I used to think this also, but now that I have experience in lecturing in a school context, I can start to see why it's nowhere near as easy as it is to be as clear and explicit as I normally am. There's just too many restrictions and things to look out for!
      Anything specific about data mining you'd like to know? It's a very broad area. I'm no expert but I'll see what I can do.

    • @caliprogrammer3456
      @caliprogrammer3456 6 ปีที่แล้ว

      0612 TV w/ NERDfirst well anything introductory really, I’m taking a data mining class next semester and from all the horror stories I’ve heard I want to at least have some basic knowledge about it as I know I’m not going to learn much from the teacher.
      And thanks again!

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว

      Cheers! I'll see what I can do. Again because "data mining" is really broad, I'll have to see how I can structure things!

  • @somethingnotspecified
    @somethingnotspecified 3 ปีที่แล้ว +10

    Just wanna say that you have created an amazing video! Learning this in College takes a lot of time, but your explanation is efficient and straight to the point. Moreover, it is easy to understand and interpret! Outstanding work!

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว +1

      Hello and thank you very much for your comment! Very happy to be of help =)

  • @5eve6322
    @5eve6322 4 หลายเดือนก่อน

    Very helpful. Thank you! You have an admirable way of explaining things very concisely and clearly

    • @NERDfirst
      @NERDfirst  4 หลายเดือนก่อน

      You're welcome! Glad you liked the video =)

  • @ayeikareviews6127
    @ayeikareviews6127 3 ปีที่แล้ว

    As someone with ADHD learning CS in college videos like this make my learning 10000xs better so THANK YOU!!!

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว +1

      Hello and thank you very much for your comment! Very happy to be of help =)

  • @reginaldmaisonneuve7594
    @reginaldmaisonneuve7594 ปีที่แล้ว

    Very well done. Particularly well structured and explained. Best I've seen on the topic.

    • @NERDfirst
      @NERDfirst  ปีที่แล้ว

      Hello and thank you very much for your comment! Glad you liked the video :)

  • @claudiodelprete3179
    @claudiodelprete3179 3 ปีที่แล้ว

    This is identical to what I need to study in my classrooms. I study Cs.
    You are the best you saved my life I am so thankful keep it up the great work.

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว

      Hello and thank you very much for your comment! Very happy to be of help =)

  • @sujeewa8067
    @sujeewa8067 3 ปีที่แล้ว

    You know the everything about this video is just perfect for me. You even used bigger fonts and dark background. The speech is very clear too. Thank you for the amazing video.

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว

      Hello and thank you very much for your comment! That's great to hear! Very happy to be of help =)

  • @Lol-mi2bf
    @Lol-mi2bf ปีที่แล้ว +1

    Great video my friend, helped me understand my textbook and my teacher

    • @NERDfirst
      @NERDfirst  ปีที่แล้ว

      Hello and thank you very much for your comment! Very happy to be of help =)

  • @AnilKumar-bh4vt
    @AnilKumar-bh4vt 5 ปีที่แล้ว +1

    4:58 Sorted my years of confusion....I though tthats the way node works ....Thanks you very much

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว +1

      You're welcome! Yes, that's a point that's quite elusive for many. Very happy to be of help =)

  • @Cerv_guitars
    @Cerv_guitars 4 ปีที่แล้ว +1

    bro this is the best explaination ive seen. exactly the way i learn. thank you.

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว +1

      You're welcome! Very happy to be of help =)

  • @aaronmeneses9201
    @aaronmeneses9201 6 ปีที่แล้ว

    Thank you so much! We are going through Doubly Linked Lists right now and I wanted to be completely sure of what I was doing. Currently, we just went over header and trailer sentinel nodes and I had no idea what was going on. I appreciate your lesson very much!

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว

      You're welcome! Very happy to be of help =) All the best for your class!

  • @abhijitharakali
    @abhijitharakali 4 ปีที่แล้ว

    Thanks a lot buddy! It's great to listen to your videos to learn about important concepts quickly.

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      You're welcome! Very happy to be of help =)

  • @mjabei
    @mjabei 4 ปีที่แล้ว

    Give this man a medal!

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      Hello and thank you very much for your comment! Glad you liked the video =)

  • @AishaStitt
    @AishaStitt 3 ปีที่แล้ว +1

    The best of the best commentary, information, and setup up visuals. Thank you so much for sharing this. What really helped as the generics mini tutorial. Alot of time people assume we know what a is. and just call it generic. But you really helped bring light to such a small term. Thank you thank you!

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว

      Hello and thank you very much for your comment! Glad to hear you found this tutorial useful! Yes, for me, Generics wasn't something that was crystal clear that didn't require explanation when I first heard of it, so I thought it'll make sense to give it a bit more context! Recently I've seen some super crazy applications of Generics that I struggled to understand, it really goes deep!

  • @shobitshobit
    @shobitshobit 7 ปีที่แล้ว +5

    YOU ARE THE BEST !! THANKS FOR A INFORMATIVE VIDEO !!

    • @NERDfirst
      @NERDfirst  7 ปีที่แล้ว +1

      Hello and thank you very much for your comment! Very happy to be of help =)

  • @chawaisX
    @chawaisX 4 ปีที่แล้ว

    Thanks for you, i understand linked list easily after watching this video 👍

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      You're welcome! Very happy to be of help =)

  • @sujeewa8067
    @sujeewa8067 3 ปีที่แล้ว

    I really like how you teach.

  • @raghavendrac3602
    @raghavendrac3602 4 ปีที่แล้ว

    Very informative, I was searching for this explanation... thanks a lot..

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      You're welcome! Very happy to be of help =)

  • @jritzeku
    @jritzeku 6 ปีที่แล้ว

    Keep up the great work! Helped me a lot! I usually watch your videos then read the textbook.

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +2

      Hello and thank you very much for your comment! That's exactly what I had intended! My videos are meant to give a pictorial overview to make it easier to dig deeper and find out more. Really happy I was able to do that for you =)

  • @user-rf4vc7mt4d
    @user-rf4vc7mt4d 4 ปีที่แล้ว +12

    haha my professor will think I've learned this from him

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว +3

      Hello and thank you for your comment! Glad to be of help =)

  • @canrt8092
    @canrt8092 2 หลายเดือนก่อน

    Great video very helpful!

    • @NERDfirst
      @NERDfirst  2 หลายเดือนก่อน +1

      Hello and thank you very much for your comment! Glad to be of help =)

  • @crzyzhaa
    @crzyzhaa 3 ปีที่แล้ว

    this helped me so much thanks

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว

      You're welcome! Very happy to be of help =)

  • @tomassmitas8375
    @tomassmitas8375 ปีที่แล้ว

    Great video! How would you print out a list of the neighbors for a particular node?

    • @NERDfirst
      @NERDfirst  ปีที่แล้ว

      Hello and thank you for your comment! Just use a loop. Maybe add a method to your node class like so:
      public void printNeighbors() {
      for (T neighbor : neighbors) {
      System.out.println(neighbor.getData());
      }
      }

    • @tomassmitas8375
      @tomassmitas8375 ปีที่แล้ว

      @@NERDfirst Thanks that works, was trying to get it for hours but I just kept printing what I think is its location

    • @NERDfirst
      @NERDfirst  ปีที่แล้ว

      Yes. In Java, you generally don't want to print objects directly unless they override toString(). Otherwise you'll just see its type and memory address, which is the default string conversion.

  • @axelpl2046
    @axelpl2046 6 ปีที่แล้ว

    Great video. Very educational.
    Thanks.

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +1

      You're welcome! Very happy to be of help :)

  • @ghennadiemazin5822
    @ghennadiemazin5822 5 ปีที่แล้ว

    Thank you very much for your time.

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว

      You're welcome! Very happy to be of help =)

  • @mohamedabdulal7067
    @mohamedabdulal7067 2 ปีที่แล้ว

    This is really helpful! thank you for making the video. I wish you made a directed and weighted graph (with edges). Do you have other videos on making the graph directed and weighted? I'm trying to implement a path finding algorithm on that graph

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว +1

      You're welcome! Glad you liked the video =)
      If you want to add weights, one way is to augment the code at 21:12 with another array or list. You already have a list of neighbors, so make another parallel list of numbers representing the weights.

    • @mohamedabdulal7067
      @mohamedabdulal7067 2 ปีที่แล้ว

      @@NERDfirst Thanks for responding... And what can I do to represent it with directions? Where two nodes can be neighbors but not bi-directional?

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว +1

      Actually, the method described here is inherently directional, so no extra work needs to be done for directionality. A node A can have an edge to another node B, but there is no mechanism to automatically link node B back to node A, so you can't go "back" through an edge.
      In fact, if you _don't_ want the edges to be directed, you have to write extra code so that whenever an edge is added from A to B, you also automatically add an edge from B to A. (A directed graph in which every edge is bidirectional and of equal weight is the same thing as an undirected graph).

  • @devinersoy
    @devinersoy 5 ปีที่แล้ว

    Very well explained thanks.

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว

      You're welcome! Very happy to be of help =)

  • @xMedivh
    @xMedivh 4 ปีที่แล้ว

    Great video, very informative!

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      Hello and thank you for your comment! Glad you liked the video =)

  • @coolsour1253
    @coolsour1253 3 ปีที่แล้ว

    Thanks, this helped a lot!

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว

      You're welcome! Glad to be of help :)

  • @ghita2003able
    @ghita2003able ปีที่แล้ว +1

    masterpiece !

    • @NERDfirst
      @NERDfirst  ปีที่แล้ว

      Hello and thank you for your comment! Glad you liked the video =)

  • @oleksandrnechaiev7153
    @oleksandrnechaiev7153 7 ปีที่แล้ว +2

    i'm greatly thankful to you!!!

    • @NERDfirst
      @NERDfirst  7 ปีที่แล้ว +1

      You're welcome! Very happy to be of help =)

  • @davidmartinezgil1215
    @davidmartinezgil1215 ปีที่แล้ว

    Bro I feel butterflies in my stomach, for the first time I achieved to understand the "Node" thing that always gave me impostor syndrome

  • @xenoxel
    @xenoxel 4 ปีที่แล้ว

    I cant run the java linked list code, both files node and linked list seem to have a main class can somebody post the node definition with the linked list class included?

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      Hello and thank you for your comment! Here's how to put everything together:
      From Node.java, find the version of Node you want to use. That to a new code page. You can safely delete the main() function if it exists.
      From LinkedList.java, copy its entire contents to the same code page as above. You can delete the main() function there if it exists.
      You can essentially leave both the above classes intact, unless you want to modify how they work. Create your own class with a main function, and ensure that this new class has the same name as your filename. Once you compile, the entry point should work as usual.

  • @daianabilbao4402
    @daianabilbao4402 6 ปีที่แล้ว +1

    For generics, I've seen people use instead of ... Is there a difference?

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +2

      Hello and thank you for your comment! There is no functional difference. It's the same idea as choosing a variable name! Pick what works best.
      Though interestingly, the Java documentation does suggest a set of names to use, and their meanings: docs.oracle.com/javase/tutorial/java/generics/types.html

  • @mattconrad6544
    @mattconrad6544 2 ปีที่แล้ว

    Thank you!

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว

      You're welcome! Glad to be of help =)

  • @magdalenastasiak8902
    @magdalenastasiak8902 5 ปีที่แล้ว

    Great work, thanks!!!

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว

      You're welcome! Very happy to be of help =)

  • @khiemgluong
    @khiemgluong 3 ปีที่แล้ว

    You're a wizard

    • @NERDfirst
      @NERDfirst  3 ปีที่แล้ว

      I'm a wot?
      All kidding aside, thank you very much for your comment! Glad you liked the video =)

  • @apoorvdixit2856
    @apoorvdixit2856 4 ปีที่แล้ว

    what will happen when we declare a variable with the class name. what does this variable will store in future.

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว +1

      Hello and thank you for your comment! Oh, this one is interesting. I've coded it up here: repl.it/@nerdfirstnet/DeeppinkPrizeAddition
      What you'll find is that Java is able to use contextual cues to distinguish which version of the name you're referring to, so there is no error, and Java can even figure out which is which. Obviously very bad practice though.

  • @glace848
    @glace848 ปีที่แล้ว

    when expanding the node class to be a generic node class, is there a way to avoid using raw types as inputs/outputs in the getter and setter functions of 'neighbors', without using an ArrayList as an output type? im a beginner so all these things are really new to me and i tried asking about this on stackoverflow but my question was immediately downvoted and closed.

    • @NERDfirst
      @NERDfirst  ปีที่แล้ว +1

      Hello and thank you for your comment! You make a really good point, actually. I probably went with raw types just because they're the one that java complains the least about - In particular, the toArray() call is tricky because Java needs to allocate memory so it didn't like it when I added the generics. setNeighbors was okay when I added generics to it.
      I don't have an answer for you right away I'm afraid, as this is the side of Java I'm not too confident about either. I'll need to refresh on my theory and dig a little deeper. If I have more insights I'll get back to you again.

  • @dar00dsandstrooom3
    @dar00dsandstrooom3 7 ปีที่แล้ว

    i wish there was a C++ version :') but nice video!

    • @NERDfirst
      @NERDfirst  7 ปีที่แล้ว

      Hello and thank you for your comment! The concepts are similar at least!

  • @joaomachado9105
    @joaomachado9105 6 ปีที่แล้ว

    Nice video! i have a doubt not about the code, but about the first three you created. it thought that in a three the max nodes a sigle node can link to was 2, and on the firs one u created with the algoritm, "C" was linked to 3 diferent nodes. Am i wrong?

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว

      Hello and thank you for your comment! A *binary tree* can only have two child nodes, but a *general tree* can have any number of child nodes!

  • @davidmartinezgil1215
    @davidmartinezgil1215 ปีที่แล้ว

    thanks

  • @hayden3774
    @hayden3774 4 ปีที่แล้ว

    Excellent. Subscribing

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว +1

      Hello and thank you very much for your comment and support! Glad you like my work =)

    • @hayden3774
      @hayden3774 4 ปีที่แล้ว

      @@NERDfirst I just watched a couple more of your videos and I learned that you went into interactive media and computer vision. That is very cool. I am currently a CS student trying to transfer to university next fall and I want to go into visual computing/computer vision too. I think I would like to help design holograms. Are you by nature more artistic? I am just curious. I was a painter/illustrator before I started going into CS.

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      Holograms sound incredible!
      I'm not sure if I'd call myself artistic. I'm certainly interested in drawing, photography, video, and things like 3D graphics and animation, but I don't think I'm really much good especially at the more artistic side of things. However, one thing I'm certain about is that computing can take art to the next level, so a blend of these disciplines is definitely a cool idea!
      Of course, one caveat about my own background is that ultimately I'm still a CS student. Going into Graphics / Interactive Media still means that I'm doing CS, just that the problems I'm solving come from the domain of graphics. This may not be what you'd expect from going down such a route, so do your research before committing!
      All the best for your uni journey =)

    • @hayden3774
      @hayden3774 4 ปีที่แล้ว

      @@NERDfirst I actually had a question about that, in one of your videos you said that there was a lot of math in your computer vision class. What kind of math?
      I don't really think art as a single thing, I think it is just an approach to a problem. Making a painting feels exactly the same as coding. I get in the zone and get to make things, solving problems is exactly the same... "Why doesnt this shading look right?" You have to think of physics of light, 3d geometry, perspective, depth of field,.. I am sure you know these things (:
      I am currently in linear algebra but I like multivariable calculus the best so far. I am afraid of discrete lol I take that next semester

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว

      The math in computer vision is largely linear algebra, at least from my limited experience. A lot of matrix stuff (as is usual in the world of computer graphics which deals with matrices of pixels). If you want to get a feel of things, you can look up things like Harris Corners detection and Lucas-Kanade Optical Flow. These are some of the ideas that stuck with me the most.

  • @AfifIszuddin
    @AfifIszuddin 6 ปีที่แล้ว

    good , i love your explain it..

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว

      Thank you very much! Glad you like the video :)

  • @Mr_Original
    @Mr_Original 6 ปีที่แล้ว

    I have a rather simple incomplete program involving nodes.
    I haven't gotten too far, but I'm having an issue.
    I've created a node and it's a string type.
    But when running the program, instead of printing the defined string, the output is the node name, followed by "@" and a bunch of letters and digits.
    Any solutions?

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว

      Hello and thank you for your comment! It sounds like you are printing your node object directly. By default, that is the behavior when you try to print a class, as Java has no idea what it's supposed to actually display.
      Here are two ways you can work around this.
      1) Create a toString() function in your class with the signature, ie.
      public String toString() { ... }
      This teaches Java how to show your class as a string, and will be used when you try to display objects using System.out.println()
      2) Alternatively, simply avoid printing your object. Instead, read the data out from your object and print that instead.

    • @aaronmeneses9201
      @aaronmeneses9201 6 ปีที่แล้ว

      It's printing the memory address.

    • @Mr_Original
      @Mr_Original 6 ปีที่แล้ว

      Okay, thanks!

  • @xBreaker666
    @xBreaker666 5 ปีที่แล้ว

    14:10 I seem to be unable to find the download in the video description

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว +2

      Hello and thank you very much for your comment! Thanks for the reminder! Here's the code, which I've just added to the video description: drive.google.com/open?id=0B2Ia5aQpQ8CnVWI5eWV3VzJod0k

    • @xBreaker666
      @xBreaker666 5 ปีที่แล้ว

      @@NERDfirst thank you :) this video is really helping me understand nodes

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว +1

      That's great to hear! Very happy to be of help =)

  • @AnaGuerra03
    @AnaGuerra03 2 ปีที่แล้ว

    what I dont get is for example in 6:20 you mention that we have to put:
    private Node next
    which will be the one with the next node, but declaration confuses me. Let me explain myself, usually when you declare something it is: int, double, float etc. but in this case it has the same name as the class, what can I achieve by declaring an object with same name as the class, because I just dont understand how that works. Please someone help me out.
    NOTE: if i am not mistaken it is what you explained on minute: 4:32, but still I have a little bit of problem understanding it limits and how can I use this information in different occations etc.

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว +1

      Hello and thank you for your comment! That's an excellent question.
      Don't be too caught up by it being "the same name as the class" - At least, not just yet. In your example, you mentioned other cases like int and float - I hope you can recognize that ultimately, these specify _types_ , ie. What _type_ of information can be contained within the variable. With this in mind, this tells us that when we say "Node next", we mean that we want to create a variable of the type Node. It being the same type as the class isn't inherently a problem at all - it just _happens_ to be the same, by coincidence, but the meaning doesn't change - It's just a data type.
      On to applications - You're right, I've actually explained this at 4:32 because I know it looks confusing, especially if you're new to Java. I'll take it that you have already watched and understood that part of the video. The purpose here is for one Node to be able to "link to" another Node, that's all. Perhaps in this case it's a little more abstract, but it's really not that strange of a use case.
      Consider another example that's hopefully more concrete - Let's say we have an Employee class, which holds details about an employee in a company. Let's say each Employee must be associated with a manager. The managers are also employees of the company, right? So they would also be defined as Employees. Thus, to describe that relationship, you would define the class like this:
      class Employee {
      private Employee manager;
      }
      That's an Employee that "contains" an Employee, and if you like, you can trace the chain of managers all the way up to the CEO! At the end of the day, we're not doing anything differently from the nodes, but this has been contextualized further, that's all. Hope this clears things up for you!

    • @AnaGuerra03
      @AnaGuerra03 2 ปีที่แล้ว

      @@NERDfirst THANK YOU SO MUCHH!! have a wonderful day and I am really sorry if I took to much of your time

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว +1

      You're very much welcome =)

  • @davidd1289
    @davidd1289 6 ปีที่แล้ว

    God bless you my friend

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +1

      Thank you! Glad you liked the video :)

  • @laurenzmatera7010
    @laurenzmatera7010 6 ปีที่แล้ว

    If I pass my exams next week I´ll buy you more than one coffee haha :)

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +1

      Hello and thank you very much for your comment! All the best for your exams :)

  • @kakashi99908
    @kakashi99908 2 ปีที่แล้ว

    Why does the node needs it's own class for example why can't a linked stack just include everything a Node does in it's own LinkedStack class? Is it because a class can not store collections of itself?

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว

      Hello and thank you for your comment! The main reason why I did it this way was to create a separation of concerns - Node only does "node things", LinkedList or whatever other container just uses Nodes. That way, a Node never needs to be aware of who uses it or how it is meant to be used. Similarly, LinkedList doesn't need to know the underlying implementation of a Node.
      Now does it _have_ to be done this way? No of course not. You can make your method work too! Ultimately OOP is just a way of modelling a problem.

    • @kakashi99908
      @kakashi99908 2 ปีที่แล้ว

      @@NERDfirst I see thanks for the explanation! Separation of concerns is always brought up so I see why it is a good idea to separate the classes. I have never seen it done with the node not being a separate class so I did not know it was even possible. It sounds kind of crazy to me, a class being able to keep track of itself without the use of another separate class.

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว +1

      You're welcome!
      In terms of what's possible, actually a lot of implementations are possible. You could build data structures entirely without OOP by just using arrays. On the other end of the spectrum you could also do a ton of crazy OOP with inheritance and all. Ultimately in the real world, we'd pick the design pattern that works best for our long term needs.

  • @EnjelMooshies
    @EnjelMooshies 7 ปีที่แล้ว

    Thank you

    • @NERDfirst
      @NERDfirst  7 ปีที่แล้ว

      You're welcome! Glad you liked the video =)

    • @prasadsanga4830
      @prasadsanga4830 6 ปีที่แล้ว

      Simple and nice explanation

  • @yancyz.h9084
    @yancyz.h9084 4 ปีที่แล้ว

    helped

    • @NERDfirst
      @NERDfirst  4 ปีที่แล้ว +1

      Hello and thank you for your comment! Glad to be of help =)

  • @johnnylor9310
    @johnnylor9310 5 ปีที่แล้ว

    I wish you were my professor. All my professor did was gave hw without examples and throw the book at you. I have spent hours reading and trying to understand things that could be taught and shown how in half an hour. A 3hr class taught me very little. Also when you ask for where your mistake are in your codes, the only response is "it's your job to find out" or answer with another question. So annoying because my program compiles to his requirements. Hands on is better than reading. I'm regretting this class already.

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว

      Hello and thank you very much for your comment! Yeah I agree! One big reason why I've continued to create videos is I've always felt this "gap" in schools... Things just aren't as pictorial as I liked! I'm glad I could be of help =)

    • @NERDfirst
      @NERDfirst  5 ปีที่แล้ว

      Regarding your edit: I'll be honest, sometimes I'm guilty of "It's your job to find out" too. But usually I do that only when I spot a _blatant_ error that they wouldn't have made if they listened in class. Not defending your professor, but sometimes there's a reason!

  • @virendrayadav4610
    @virendrayadav4610 2 ปีที่แล้ว

    👍🏻🔥

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว

      Hello and thank you for your comment! Glad you liked the video =)

  • @167mm167
    @167mm167 6 ปีที่แล้ว

    awesome

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว

      Thank you very much! Glad you liked the video =)

  • @richardtriance5207
    @richardtriance5207 9 หลายเดือนก่อน +1

    ...Great Video. Even better than that bald headed guy, that goes 'Meoow!'

    • @NERDfirst
      @NERDfirst  9 หลายเดือนก่อน

      Hello and thank you for your comment! Can't say I know who that is, but thank you anyway!

  • @shahriarmim4696
    @shahriarmim4696 6 ปีที่แล้ว

    we can have Object type data type so why do we need generics ? An Object class data type can hold anything. Like, private Object data ;
    variable, data can hold Integer, String, Double etc. Does the same work ! Why do we need generics then ?

    • @NERDfirst
      @NERDfirst  6 ปีที่แล้ว +1

      Hello and thank you very much for your comment! Great observation.
      The unfortunate thing about this is that while you _can_ store the information as an Object, you won't be able to retrieve it correctly without hardcoding it. When you cast the type of anything to Object, you're essentially throwing away its original type. You can "re-cast" it back to the right type if you know what it is, but you don't always! Using generics allows you to be explicit about the type so no information is lost.

    • @shahriarmim4696
      @shahriarmim4696 6 ปีที่แล้ว

      Oh.. Now I got this ! Thanks

  • @Alifofara
    @Alifofara 2 ปีที่แล้ว

    it was all fine and dandy, understood everything untill I started copying the code.
    The method insert(int,int) is undefined for the type LinkedList
    The method find(int) is undefined for the type LinkedList
    so yeah... that.

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว

      Hello and thank you for your comment! Java isn't able to find the functions insert() and find() in your LinkedList class for some reason. Either you've mispelled the function names in the definitions, or the types expected as parameters do not match somehow.
      You may want to refer to the official code downloads listed in the video description for something to compare against and to diagnose the error.

  • @Tbag09
    @Tbag09 2 ปีที่แล้ว

    thank you

    • @NERDfirst
      @NERDfirst  2 ปีที่แล้ว

      You're welcome! Glad to be of help =)