Big O Flashcards

1
Q

O(1)

A

Constant time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Types of 0(1) operations

A
Array access by index
Math
Hash by key
Pushing, popping on stack
Insertion and removal from queue
Return value from function
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

O(n)

A

Linear increase with size of dataset
Map, reduce,
Looping through something etc

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

O(n^2)

A

Quadratic time

  • nested loops
  • bubble sort and other simple sort algorithms
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

O(n log n)

A

Linearithmic
Merge sort
Timsort
Heapsort

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Call stack

A

Responsible for keeping the flow of execution

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Heap

A

Memory allocation accessible by all threads

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Young generation

A

It’s the portion of the memory where all the new data(objects) are made to allocate the space and whenever this memory is completely filled then the rest of the data is stored in Garbage collection.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Old/Tenured generation

A

This is the part of Heap-memory that contains the older data objects that are not in frequent use or not in use at all are placed.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Permanent generation

A

This is the portion of Heap-memory that contains the JVM’s metadata for the runtime classes and application methods.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly