Big O Flashcards
O(1)
Constant time
Types of 0(1) operations
Array access by index Math Hash by key Pushing, popping on stack Insertion and removal from queue Return value from function
O(n)
Linear increase with size of dataset
Map, reduce,
Looping through something etc
O(n^2)
Quadratic time
- nested loops
- bubble sort and other simple sort algorithms
O(n log n)
Linearithmic
Merge sort
Timsort
Heapsort
Call stack
Responsible for keeping the flow of execution
Heap
Memory allocation accessible by all threads
Young generation
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.
Old/Tenured generation
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.
Permanent generation
This is the portion of Heap-memory that contains the JVM’s metadata for the runtime classes and application methods.