1what is immutable
data can not be changed
2what is mutable
data can be changed
3What is list
An ordered data structure in which values have an index and is non-contiguous; mutable and can store various data types
4What is an array
Like a list(mutable) but its contiguous, ,static and only store one data type
5What is tuple
Lists that are immutable, static but store various data types
6static meaning
its size cannot be changed afterwards
7dynamic meaning
its size can be changed afterwards
8what stack
A LIFO structure which has a stack pointer pointing at top node
Items can only be added / removed from the top
9what queue
A FIFO structure in which has two pointers FRONT and REAR that track the items. Items are added at the rear and removed from the front
10Circular queue
a type of queue in which front and rear pointers can wrap around to reuse spaces
11Priority queue
Items are given priority and those with the highest go to the front
12what is linked list
Dynamic data structure in which each item is called a node, and contains an index, data and pointers which give location of next node
13what tree
A data structure which consists of nodes and pointers.
14What do trees have
root node , leaf nodes , edges/pointers and child nodes
15whats a sub tree
A set of nodes and pointers from any single node down to its leaf nodes
16Whats a binary tree
Type of tree which nodes can have up to two child nodes
17How to delete nodes
1) If node is a leaf node - Just delete it
2) If node has one child node- Set previous pointer to child
3)If node has two child nodes. Set previous pointer to child which is next in a inorder traversal.
18How to add to a linked list(if node is supposed to be in between)
1)Check if free space
2)Create the node and insert data in it
3)Have previous node point to it
4)Set new nodes pointer to point next node
5)Update free pointer
19How to remove from linked list:(lets say ben)
1)Check if empty
2)Find Ben
3)Remove bens pointer
4)Update previous pointer to point to next node
5)Update free pointer
20What graph
Data structure made of nodes and pointers.
Each node can have > 2 pointers and point to ANY nodes
21What other special stuff with em?
Can point in two/one directions or not specify
Can be weighted
22Uses of graphs
Mapping road networks for navigation
Social media network
Representing molecular structures
23How to do breadth first search (A- B -E-G.
A-C
A-D -F
current node = CN
Result = R
Q= queue

1)Visit first node A. Place in CN and R
2)Visits all its 1st connections. B C D. Place them in Q and R
3)Find next CN which is B remove it from Q
4)Visits its 1st connections
- repeat until all found
A B C D E F G

24How to do DEPTH first search (A- B -E-G)
A-C
A-D -F

1)Visit first node A. Place in S and R
2) Visit alphabetical next so B and visit the whole path. Putting them in S and R
3)When path end or same node pop stack until new connection
Repeat until all found
A B E G C D F

25How to add in stack/queue
1)Check for overflow
2)Increment stack/ back pointer
3)Insert data
26How to remove in stack/queue
1)Check for underflow
Stack:
2)Remove last item
3)Decrement pointer
Queue is opposite
27Traversals?
Pre order- Root L R
Inorder - L Root R
Postorder - L R Root
28whats the goal of a hash table?
Immediately find an item in un/sorted list without comparing items
29How it works? key = initial data
1)Initial data passed into hash function
2)It converts it into hash address
3)Hash address tells where to store
30Whats a collision
Two keys trying to take same address
31How to counter collisions?
Open addressing - check next available spaces and store it there
Chaining - 2D array to store it. Overflow Linked list can be used
32How is data in open addressing found?
Linear probing - function sends start position of where linear search can be done until its found
33A good hash function should:
Be calculated quickly
Result in as few collisions as possible
Use as little memory as possible