mid2 Flashcards
1
Q
Push LL Complexity
A
O(1)
2
Q
Pop LL Complexity
A
O(1)
3
Q
Push AL Complexity
A
O(N)/*O(1)
4
Q
Pop AL Complexity
A
O(N)/*O(1)
5
Q
Enq LL Complexity
A
O(1)
6
Q
Deq LL Complexity O(1)
A
O(1)
7
Q
Enq AL Complexity
A
O(N)/*O(1)
8
Q
Deq AL Complexity
A
O(N)
9
Q
Enq AL Circular Complexity
A
O(N)/*O(1)
10
Q
Deq AL Circular Complexity
A
O(N).*O(1)
11
Q
RBT additional reqs
A
-Each Node is either red or black
-Root is always black
-Every path from root to all null leaves encouters the same # of black nodes
-No adjacent (parent/child) red nodes
12
Q
Breadth-first order
A
Print in perfect horizontal order
13
Q
Preorder
A
Head -> Left -> Right
14
Q
Postorder
A
Left -> Right -> Head
15
Q
In order
A
/\ Formation, Left -> Head -> Right