Mock Feb Flashcards
1
Q
What is the constant graph with big O notation?
A
- O(C)
- Example y=3
- Used for identifying odd or even
2
Q
What is the logarithmic graph with big O notation?
A
- O(log_2(n))
- y = log(x)
- Binary Search
3
Q
What is the linear graph with big O notation?
A
- O(n)
- y = 3x
- Linear Search
4
Q
What is the Linear Logarithmic big O notation?
A
- O(nlog(n))
- Used for merge sort
5
Q
What is the graph for polynomial with big notation?
A
- O(n^2)
- y=x^3
- USed for bubble sort
6
Q
What is the exponential graph?
A
- O(2^n)
- y=3^x
- Recursively calculating fibonacci numbers
7
Q
What is LIFO?
A
- Last in first out
- Last item you push is the first item that you pop
- Used in Stacks
8
Q
What is FIFO?
A
- FIrst in first out
- Popped in the front
- Pushed from the back
9
Q
What is a stack?
A
- A way of storing objects
- Uses a single pointer which keeps moving to point to the current item
- Pushing an item onto a full stack will cause stack overflow
- Poppng an item in an empty stack will cause stack underflow
10
Q
What are strong data structure?
A
- Standard types
- Basus for other types
- Fixed allocated amount of memory when defined
- Interger,character,strong
11
Q
Whats the advantages of a static data structure?
A
- Fixed memoery allocation - easy to add and remove items
- Easier to program - no checks on data structure size at any point
12
Q
What are the disadvantages of static data structures?
A
- Unefficient as memoery has been set aside regardless of weather its needed or not whilst the program is executing
13
Q
What are dynamic data structures?
A
- Memoery allocated as the program executes
- Used when the amount of items in a list is unkown
- Requires a maximum size avoiding memory collisions
14
Q
What are the disadvatages of dynamic data structure?
A
- Overflow and underflow possible due to dynamic memory allocation
- Harder to program as software needs to keep track of its size and data item locations
15
Q
What the advantage of dynamic data structures?
A
- Most efficient use of memory as only whats needed is used