Linked Data Structures

PowerPoint – Lecture Notes – Linked Data Structures
PowerPoint CIS016 Java Week 22 – Linked Data Structures

Linked Data Structures Example Code (ZIP)

Linked Lists Example Code (ZIP)

More Example Code (ZIP)

Linked List Worksheet – Linked Data Structures 1

Linked List Worksheet Solution (ZIP)


Singly Linked Lists
(https://www.youtube.com/watch?v=5nsKtQuT6E8)

Published on 23 Oct 2012


Singly-Linked Lists
(https://www.youtube.com/watch?v=ZoG2hOIoTnA)

Published on 14 Oct 2015


Doubly-Linked Lists
(http://bedford-computing.co.uk/learning/wp-admin/post.php?post=3089&action=edit)

 

Published on 14 Oct 2015


Linked Lists
(https://www.cs.cmu.edu/~adamchik/15-121/lectures/Linked%20Lists/linked%20lists.html)

One disadvantage of using arrays to store data is that arrays are static structures and therefore cannot be easily extended or reduced to fit the data set. Arrays are also expensive to maintain new insertions and deletions. In this chapter we consider another data structure called Linked Lists that addresses some of the limitations of arrays.

A linked list is a linear data structure where each element is a separate object.


Each element (we will call it a node) of a list is comprising of two items – the data and a reference to the next node. The last node has a reference to null. The entry point into a linked list is called the head of the list. It should be noted that head is not a separate node, but the reference to the first node. If the list is empty then the head is a null reference.
A linked list is a dynamic data structure. The number of nodes in a list is not fixed and can grow and shrink on demand. Any application which has to deal with an unknown number of objects will need to use a linked list.
One disadvantage of a linked list against an array is that it does not allow direct access to the individual elements. If you want to access a particular item then you have to start at the head and follow the references until you get to that item.
Another disadvantage is that a linked list uses more memory compare with an array – we extra 4 bytes (on 32-bit CPU) to store a reference to the next node.

Linked List Example Code
LinkedList Example Code (ZIP)


Java LinkedList class
(http://www.javatpoint.com/LinkedList-in-collection-framework)

  • Java LinkedList class uses doubly linked list to store the elements. It extends the AbstractList class and implements List and Deque interfaces.
  • Java LinkedList class can contain duplicate elements.
  • Java LinkedList class maintains insertion order.
  • Java LinkedList class is non synchronized.
  • In Java LinkedList class, manipulation is fast because no shifting needs to be occurred.
  • Java LinkedList class can be used as list, stack or queue.

Java – The LinkedList Class
(http://www.tutorialspoint.com/java/java_linkedlist_class.htm)

The LinkedList class extends AbstractSequentialList and implements the List interface. It provides a linked-list data structure.


How To Implement a LinkedList Class From Scratch In Java
(http://crunchify.com/how-to-implement-a-linkedlist-class-from-scratch-in-java/)


Linked Lists
(http://www.mycstutorials.com/articles/data_structures/linkedlists)

Linked Lists are a very common way of storing arrays of data. The major benefit of linked lists is that you do not specify a fixed size for your list. The more elements you add to the chain, the bigger the chain gets.
There is more than one type of a linked list, although for the purpose of this tutorial, we’ll stick to singly linked lists (the simplest one). If for example you want a doubly linked list instead, very few simple modifications will give you what you’re looking for. Many data structures (e.g. Stacks, Queues, Binary Trees) are often implemented using the concept of linked lists.


Linked List Tutorial
(http://www.dreamincode.net/forums/topic/143089-linked-list-tutorial/)

Linked Lists are an alternative to ArrayLists that Computer Scientists have come up with. While an ArrayList uses an array internally to store the data, a LinkedList uses nodes to hold the elements. These nodes then point to each other, thus leading to the name “Linked” List. There are three types of Linked Lists: singly-linked lists, doubly-linked lists and circularly-linked lists.


Linked List in Java
(https://www.youtube.com/watch?v=195KUinjBpU)

Published on 3 Mar 2013
Get the Code: http://goo.gl/T40EF

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.


Linked List in Java 2
(https://www.youtube.com/watch?v=iR5wyCaIayk)

Published on 7 Mar 2013
Get the Code: http://goo.gl/DZ3al

In the last video, I showed you how to create Linked Lists and how to manipulate them.
In this tutorial, I will cover Double Ended Linked Lists which have a reference to the first and last link. I cover how a Doubly Linked List allows you to go backwards and forwards in a list. Then we take a look at Iterators and how they work.


See Java Algorithms Video Tutorials on this website