auto update

This commit is contained in:
Jet Hughes 2022-04-06 22:54:35 +12:00
parent 611f6d0f94
commit cbd1323c72
3 changed files with 43 additions and 0 deletions

View File

@ -0,0 +1,10 @@
---
title: "09-stacks-and-queues"
tags:
---
# 09-stacks-and-queues
- [[stacks-and-queues]]
- [[notes/priority-queue]]
- [[notes/heap]]

View File

@ -0,0 +1,16 @@
---
title: "priority-queue"
tags: cosc201 datastructure
---
# priority-queue
- A dynamic linear data type that supports addition and removal on entrie
- each entry hase a value and a priority (key)
- removal returns the item with the greatest priority
## 1 Implementation
1. stoes items and priorities in an array. Add at the end ϴ(1), remove by finding the maximum and exchaning with the end element ϴ(n)
2. stores items and their priorities in an array (or list) in sorted order. now removal is ϴ(1) bu addition in Ο(n)

View File

@ -0,0 +1,17 @@
---
title: "stacks-and-queues"
tags:
---
# stacks-and-queues
Dynamic linear data types (interface)
- an abstraction of a collection of data organised "in a line" which supprts addition of new elements and the removal of (some) old elements
- e.g., stacks and queues
- the difference in the removal operation
- stacks ⇒ (pop) LIFO
- queues ⇒ (remove, offer, pull) FIFO
- representation
- array (preffered because of memory management)
- linked list (seems more natural)