unit 3 Flashcards
(25 cards)
what is an array
list within a code
fixed in size and need declaring before use
what is a 1d array
most basic array
single index to reference
use a single access method
what is a 2d array
grid of rows and columns
data is accessed using a row and column indicator
what is a 3d array
cube like structure of 2d arrays
layers rows and columns
what is a stack
data structure capable of holding a linear sequence of items
last in first out
one item is pushed in and first item is popped
what is a push operation
adds a new item to stack
each item added adjusted the top pointer position
what is a pop operation
removes an item
only adjusts the top pointer may not remove data
what is a linked list
dynamic data structure
head and tail pointers
can be ordered or unordered
when removing gives a previous node the deleted nodes pointer
what is a queue
holds linear sequence of items
first in first out
what does enqueue do
adds an item to the queue
what does dequeue do
removes the oldest item in the queue
what is a binary tree
root node connected to child nodes/parent nodes
what are the uses of a binary tree
storing ands managing files
path finding algorithms
records data by heirarchy
what is data
what’s being stored
what is a left pointer
location of left child node
what is a right child node
location of right child node
what is pre order traversal
node left right
start at root, follow left node down then follow right edge
what is in order traversal
left node right
start at left node, then to root then to right node
what is post order traversal
left right node
start at root, go left, go right
what is a hash table
makes use of array
generates an index number from the data
fast access
what is the load factor
n/k
occupied/total number
what is a hash function
hash value from a key then undergoes a MOD calculation
what are collisions
data gets overwritten when the hash functions produce the same hash values for two or more keys
what is linear probing
stores the value in the next available space when collision occurs
very slow