Zusammenfassung der Ressource
Linked Lists
- Variable size
- Change in real
time (on run time)
- composed of nodes
- structs
- contains the
data types you
want
- one element is a
pointer to the next
node
- Saved in the heap
- dynamic memory
- malloc
- each node individually
- Assert
- sizeof
- free
- Each node individually (loop)
- ALWAYS started by
the head pointer
- The first thing you ALWAYS
do is declare and initialize
the head pointer,
- Singly linked
- list pointing in one direction
- once you go to the next
node, you can't get back,
UNLESS you keep track of
the previous node
- have a 'previous' pointer
- End of the list is
represented by
NULL
- Always begin by initializing
the next pointers to NULL
- 2 'types' of lists
- empty
- head == NULL
- full or occupied
- head == address
to a node
- 3 conditions to check
- At the front
- At the back
- At the middle
- List Traversal
- For loop
- Stop when reach the next=null