describe arrays
describe linked lists
big O to locate an item in a linked list
n
big O to insert an item in a linked list
1
big O to delete an item in a linked list
1
big O to insert an item into an array
last element - 1
element at i - n
big O to delete an item into an array
last element - 1
element at i - 1
big O to locate an item into an array
unsorted - n
sorted - log n
describe ADT stack
uses of stacks
describe ADT queue
uses of queues
define priority queues
array implementation of stacks
limited size
linked list implementation of stacks
‘unlimited’ size
- but extra-memory references
applications of priority queues
describe heap implementation
describe trees
each node in a tree, except the root, has one parent
- parent-child relationship
- nodes without child-nodes = leaves
2 conditions of a complete binary tree
define heap
a complete binary tree down to a depth of d - 1 and the nodes with depth d are as far left as possible
2 properties of heaps
describe a heap as its array implementation
illustration - ordered binary tree
programs - array
- root node = A[0]
- parent node = A[i]
- 2 child nodes = A[2i + 1] and A[2i + 2]
heap insert
heap delete