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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the logarithmic graph with big O notation?

A
  • O(log_2(n))
  • y = log(x)
  • Binary Search
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the linear graph with big O notation?

A
  • O(n)
  • y = 3x
  • Linear Search
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Linear Logarithmic big O notation?

A
  • O(nlog(n))
  • Used for merge sort
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is the graph for polynomial with big notation?

A
  • O(n^2)
  • y=x^3
  • USed for bubble sort
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the exponential graph?

A
  • O(2^n)
  • y=3^x
  • Recursively calculating fibonacci numbers
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is LIFO?

A
  • Last in first out
  • Last item you push is the first item that you pop
  • Used in Stacks
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is FIFO?

A
  • FIrst in first out
  • Popped in the front
  • Pushed from the back
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are strong data structure?

A
  • Standard types
  • Basus for other types
  • Fixed allocated amount of memory when defined
  • Interger,character,strong
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What the advantage of dynamic data structures?

A
  • Most efficient use of memory as only whats needed is used
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is heap?

A
  • Pool of memory to allocate variables during execution of programs
  • Makes dynamic variables possible due to changes in variable size during execition
  • Allows for efficient use of memory with data of unkown chanigng size
17
Q

What is memory leakage?

A
  • Program assigns memory to variable but doesnt reassign back to heap once finished
  • Repeating until memory runs out and crsh occurs
18
Q

What is a garbage collector?

A
  • Common in modern programming langages
  • Checks memory assigned to dynamic variables and checks if they are completed
  • And automatically free the memory