pre order
dots to the left
in order
dots on the bottom
post order
dots on the right
linked list characteristics
how to create binary trees
from first element - bigger (right) smaller (left)
remove from a binary tree with 2 children
go the right pointer and find the lowest value child from that element then replace the value being deleted with that child
what is a data structure
a set of related data items
why are the data structures are useful
an example of data that could be stored in a 2D array
sales of each product number by month
what are the key features of an array
give an example of data that could be stored in 3D arrays
what is a record data and structure and when would they be used
drawbacks of using 3D arrays
what data is suitable for a 1D array
when the data set comprises of single values of the same data type
what is a stack
Examples of when a stack could be used
what is a queue
operates on the FIFO principle and data items are added at the end of the queue and removed from the front
what happens when there is an attempt is made to add an item to a full queue
returns an appropriate message or condition
(produces an error message)
examples of where a queue could be used in computing and why
what is a linked list (simple)
a set of data elements, where each element contains the data itself and a pointer to the next element
advantages and drawbacks of a linked list compared to an array
advantages:
- new items can be inserted into a linked list without rearranging all the other elements
- if programmed dynamically uses memory more efficiently
disadvantages:
- a linked list is more complex to program/ manipulate than an array
- extra programming is required to access the data in the opposite direction
- can only be accessed in a linear manner
what is an unbalanced binary tree
not the same amount on each branch
example of in order traversal
-searching for a file in the file system
-listing files in alphabetical order
example of post order traversal
delete all the files in the file system (each folder could only be deleted once all the files beneath have been deleted)