Time Complexities Flashcards
1
Q
Deleting from front of Array
A
O(n)
2
Q
Deleting from end of array
A
O(1)
3
Q
Insertion into ordered array
A
O(n)
4
Q
Reading from array
A
O(1)
5
Q
Reading from linked list
A
O(n)
6
Q
Insertion into linked list
A
0(1)
7
Q
Searching ordered array
A
O(1)
8
Q
Quicksort
A
Average: O(N log N)
Worst: O(N^2)
9
Q
Quickselect
A
O(n)
10
Q
Searching linked lists
A
O(n)
11
Q
Deletion in Linked List
A
O(n)
O(1) at beginning
12
Q
Searching binary tree
A
O(LogN)
13
Q
Inserting in Binary Search Tree
A
O(logN)
14
Q
Deletion in Binary search tree
A
O(logN)
15
Q
Inserting into a heap
A
O(logN)