single and double linked lists

185 views

I read it like 5 times and I don’t understand

In: 1

4 Answers

Anonymous 0 Comments

Imagine a warehouse filled with boxes, you open up tge first box, and it contain3s some stuff, and also the location of box 2. Box 2 has its stuff and the location of box 3, and so on. If you hit box 7, grab its contents, and realize you need box 2’s stuff again, the only real way to remember exactly where it was is to look in box one again. That’s a singly linked list. A doubly linked list would also have to location of the previous box in addition to the next one (ie the location of box 6 and 8 are inside box 7)

You are viewing 1 out of 4 answers, click here to view all answers.