5.1.11-5.1.13+Linked+lists

=__**5.1.13 - Sketched linked lists (single, double and circular).**__=

Notes: Students should be able to sketch diagrams illustrating: adding a data item to linked list, deleting specified data item, modifying the data held in the linked list, search for a given data item.

__**Linked Lists**__
 * Definition:
 * data structure (abstract data type)
 * group of nodes representing a sequence
 * node = data + link to the next node
 * order important
 * value can occur more than once
 * behaviour
 * add element
 * remove element
 * find element
 * **list end**: indicated through the reference being **null**
 * **list start**: external reference which is **head (ref.)** referencing the start of the list
 * advantages:
 * easy adding or removing of nodes without need to relocate or reorganise the list
 * disadvantages
 * requires sequential scanning

media type="custom" key="27438556"

__**Single linked list**__
 * only can move to the next field
 * can: add, remove, pass node



__**Double linked list**__
 * second reference link pointing to the previous node



__**Circular linked lists**__
 * the last node that is should contain the reference null, references back to the first node



__**Sketching diagrams**__
 * Adding a node
 * access the previous item --> change the reference to the item you would like to insert
 * change the reference of the item you would like to insert to the next node (the node that is supposed to follow)




 * Removing a node
 * delete node
 * access the previous node and change the reference to the next node after the deleted one




 * Modifying




 * Searching

[]
 * A great reference:**

Created By: Lucie Magister Last update: 18/04/2015

Sources:
 * "Insert." Wikimedia Commons. N.p., n.d. Web. 18 Apr. 2015. .
 * "Linked List." Wikipedia. Wikimedia Foundation, n.d. Web. 18 Apr. 2015. .
 * "Linked Lists in 10 Minutes - I." YouTube. YouTube, n.d. Web. 18 Apr. 2015. .
 * "Further Programming in Java." Linked List Operations. N.p., n.d. Web. 21 Apr. 2015. .