Data Structures Advanced Damian Gordon Advanced Data Structure
- Slides: 51
Data Structures: Advanced Damian Gordon
Advanced Data Structure • We’ll look at: – Linked Lists – Trees – Stacks – Queues
Linked Lists • Imagine we wanted to have an array where we can dynamically add elements into it, and take them away. • We can do this with a linked list.
Linked Lists • A linked list is made up of nodes.
Linked Lists • A linked list is made up of nodes. • Each node has two parts to it:
Linked Lists • A linked list is made up of nodes. • Each node has two parts to it: Value Pointer
Linked Lists • For example
Linked Lists • For example 23
Linked Lists • For example 23 62
Linked Lists • For example 23 62 37
Linked Lists • For example 23 62 37 31
Linked Lists • For example 23 62 37 31 NULL
Linked Lists • For example 23 Start of List 62 37 31 NULL End of List
Linked Lists • To add a value in: 23 62 37 31 NULL
Linked Lists • To add a value in: 23 62 37 26 31 NULL
Linked Lists • To add a value in: 23 62 37 26 31 NULL
Linked Lists • To add a value in: 23 62 37 26 31 NULL
Linked Lists • To add a value in: 23 62 26 37 31 NULL
Linked Lists • To delete a value: 23 62 26 37 31 NULL
Linked Lists • To delete a value: 23 62 26 37 31 NULL
Linked Lists • To delete a value: 23 62 37 31 NULL
Trees • We can also have a tree:
Trees • We can also have a tree: • A tree is made up of nodes. • Each node has three parts.
Trees • We can also have a tree: • A tree is made up of nodes. • Each node has three parts. • A value and two pointers, a left and a right one. Value Left Right
Trees 23 • This is what it looks like: 68 33 14 53 11 83 77 27
Trees Root 23 • This is what it looks like: Parent 68 33 14 53 11 Leaf Child 83 77 27
Stacks • We can also have a stack:
Stacks • We can also have a stack:
Stacks • We can also have a stack: • It’s a structure that conforms to the principle of Last In, First Out (LIFO). • The last item to join the stack is the first item to be served.
Stacks 59 53 26 59 41 31
Stacks 59 53 26 59 41 31 Top Bottom
Stacks • Values are added to the top:
Stacks • Values are added to the top: 67 59 53 26 59 41 31
Stacks • Values are added to the top: 67 59 53 26 59 41 31
Stacks • Values are added to the top: 67 59 53 26 59 41 31
Stacks • Values are removed from the top: 67 59 53 26 59 41 31
Stacks • Values are removed from the top: 67 59 53 26 59 41 31
Stacks • Values are removed from the top: 59 53 26 59 41 31
Queues • We can also have a queue:
Queues • We can also have a queue:
Queues • We can also have a queue: • It’s a structure that conforms to the principle of First In, First Out (FIFO). • The first item to join the queue is the first item to be served.
Queues 59 53 26 59 41 31
Queues 59 Back 53 26 59 41 31 Front
Queues • Values are added to the back: 59 86 53 26 59 41 31
Queues • Values are added to the back: 59 86 53 26 59 41 31
Queues • Values are added to the back: 86 59 53 26 59 41 31
Queues • Values are removed from the front: 86 59 53 26 59 41 31
Queues • Values are removed from the front: 86 59 53 26 59 41 31
Queues • Values are removed from the front: 86 59 53 26 59 41 31
Queues • Values are removed from the front: 86 59 53 26 59 41
etc.
- Damian gordon
- Intitle:"index of" "/usernames"
- Damian gordon
- Advanced data structures in java
- Advanced data structures in python
- Homologous structures definition
- Passive advanced structures
- Advanced design of steel structures notes
- Damian sturzaker
- Padre damian de veuster 2215 vitacura
- Estructura de una biografia
- Padre damian de veuster 2215 vitacura
- Damian clancy
- Damian krysztofik
- Damian folch
- Damian urbańczyk z żoną
- Christophe damian
- Damian mac
- What did fray damian massanet do
- Padre damian de veuster 2215 vitacura
- Padre damian de veuster 2215
- Damian harding
- Damian urbańczyk wikipedia
- Damian topolski
- Oscar sandoval md
- A 1017
- Melissa damian
- дејмијан марли музичар
- Damian czudek
- Dana damian
- Iru academy
- Tautology python
- 666 rule powerpoint
- Static data structures
- Apa itu record
- Advanced higher modern studies essay structure
- Btech smart class.com
- Types of data structures in r
- Oblivious data structures
- Kernel data structures
- Introduction to data structures
- Introduction to data structures
- Ajit diwan
- Esoteric data structures
- Geometric data structures
- Princeton data structures and algorithms
- Data structures and algorithms tutorial
- Hadoop i/o
- Macro instruction
- Assembler data structures
- Classic data structures by debasis samanta ppt
- Persistent vs ephemeral data structures