In this video, I’ll cover how work with a linked list in java. I’ll show you how they work in 4 different ways.
We’ll cover how to create them, what a link is, how to add and delete links, how to search through them and a whole bunch more. The basics you need to understand at the end are that: 1) A Link is an Object 2) Each Link has a reference to another Link in the List 3) The LinkedList has only a reference to the last Link added to it.
If you like videos like this, it helps to tell Google+ [googleplusone]
Code From the Video
Link.java
LinkList.java
Hi darek nice video as always.
also i am curious to know, if you have any idea about how to generate 3d data for performance testing, any tool for that, or how to automate it?
Thanks,
Punit
Do you mean how do we show a 3D graph of data? I’m going to cover that in my Java 3D tutorial
Okay more precisely, so far we are creating data (2d data), using xml’s and loading that to our product and testing our application.
now we need for 3d data to test our application, so is there any way to create 3d data?
I was doing a program in the roman numeral using RomanNumeralGUI,RomanNumeralList, RomanNumeralLinkList and RNLinkListIterator. when I built the frame of RomanNumeral and I entered JMenu , it suppose to enter the roman numeral sorted and Unsorted and when I press add ‘M’ for example it should enter it and when i press “delete” it should delete . so my question is to delete the roman numeral….
I’m sorry, but I don’t understand the question? What tutorial are you referring to here?
Great tutorials, thanks. Anyway there is a small typo:
while(theLink.bookName != bookName){
should be
while(!theLink.bookName.equals(bookName)){
thank for save me.wish you have many tutorial very well.
You are very welcome 🙂
I’m getting a sort of error. The program is printing the references for theLink.next, instead of the book name. I bypassed this problem by taking your toString() method from Link() and using it inside of LinkList.display() inside of the while loop.
However, I’m curious as to how I can fix this problem otherwise. Everything else worked fine, except for when I was initially making use of the LinkList.display().
When the program printed “Next Link: <expected book name" I got a reference/object instead, not the object's string contents. What should I be looking at to solve this?
Are you using the code I provide on my site?
why are there 2 files? may i put them in 1 file?
You could define an inner class with one of them, but I think that would be confusing
Is a link considered to be a node?
Yes they are very similar
Good lord this is amazing!
Thank you so much!
I wish there were more people like you out there that can I actually teach!
You’re very welcome 🙂 Thank you for the nice compliment.
Good work. it’s helpful. Thank you very much.
Thank you 🙂
Awesome work !
Thank you very much 🙂
Awesome tutorial Derek, as always you are!
I’m having a hard time to understand the difference between newlink.next & newlink….still confused
newLink.next = firstLink;
firstLink = newLink; which one is the address?
Thank you 🙂 Each node (link) has a reference to the next node (link) in the chain. When I make the first node here is no other nodes so next gets the value of null.
When I do add a new node I assign it to the the last node that was created. I put a reference to it in next.
Think of it as a bunch of boxes. In each box there is a piece of paper that tells you what box to open up next. If you decide you want to add on a new box just right that boxes name on a piece of paper and stick it in the box that proceeds it.
I hope that helps
Derek
Hi Derek, I watched your video tutorial, and I am very new to Java..
I am having difficultties on how will I Integrate Scanner in Linkedlist “where user can input , say or example the bookname”. I have tried all the possible things that I could try, but still having trouble.
I hope you’ll be able to help me with this..
Thanks
Check out this tutorial for ways to use scanner. I hope it helps 🙂
hi Derek , i am new for java code and I have straggle in Multi-Linked Lists. if you know any books to reference or if you make video .
I have a video here on doubly linked lists.
Hi Derek,
Thanks for the video, it’s very helpful!!!
I’m new to Java, Can you tell me how can I compile those two files by using “package”, or is there another way of compiling those two files? Thanks!!
Hi David,
Sorry, but I don’t understand the question. Can you give me an example?
You are amazing 🙂 finally able to understand the Linked List. Thanks
Great I’m very happy that I could help 🙂