| Terms |
Definitions |
|
Stack (Array)isEmpty()
|
O(1)
|
|
Stack (Array)pop()
|
O(1)
|
|
Queue (LL)enqueue()
|
O(1)
|
|
List (LL)Summing/Max/min
|
O(N)
|
|
List (Array)Summing/max/min
|
O(N)
|
|
Queue (LL)isEmpty()
|
O(1)
|
|
Stack (LL)peek()
|
O(1)
|
|
Stack (Array)push()
|
O(1)
|
|
Stack (LL)push()
|
O(1)
|
|
Queue (Circular Array)enqueue()
|
O(1)
|
|
HeapHeight running time
|
O(logN)
|
|
List (Array)Search unsorted
|
O(N)
|
|
List (LL)Search unsorted
|
O(N)
|
|
List (Array)Delete last
|
O(1)
|
|
List (Array)Search sorted
|
O(logN)
|
|
List (Array)Delete first
|
O(N)
|
|
List (LL)Add to sorted spot
|
O(N)
|
|
Heapright child formula
|
2i + 2
|
|
Heap properties
|
Complete until last levelheight O(logN)Parents are always less than the children
|
|
Stark
|
adj bare, simple or obvious, especially without decoration or anything which is not necessary; severe or extreme "The stark reality is that..." "The suburbs stand in stark contrast to the slums"
adv completely or extremely "Stark naked" "starkly contrast
|
|
Stack (Array)push (how to)
|
if top+1 == arr.lengthresizealsotop++arr[top] = item;
|
|
Number of elements in a Tree
|
2^n+1 - 1
|
|
Scramble
|
verb to move or climb quickly, but with difficulty, often using your hands to help you;
verb to compete with other people for something there is very little of "People are now scrambling to get one of the three Harvard Vacancies"
|
|
Stack (Array)pop (how to)
|
if top == -1, throw exceptionelsereturn arr[top--];
|
|
dub
|
verb to give sb or sth a particular name, especially describing what you think of them "She was dubbed the angel of death"
verb to change the sounds and speech on a film or television program, especially to a different language "the film was dubbed into
|
|
BST Find minimum
(How to)
|
IF root has not children, throw exception Else go left until current node has no children, then return current node
|
|
drown sth out
|
if a loud noise drowns out another one, it prevents it from being heard "Singing drowned out the fear"
|
|
Stack (LL)pop() [how to]
|
if top is null -> throw exceptionelse T temp = top.element; top = top.link; return temp;
|
|
BST Find (how to)
|
If root is null{return false}else{ if element == root return true; else{ if element is smaller, call on left child if element is greater, call on right child
|
|
BST Delete (how to)
|
One child: link previous child up to the new root/parent Two Childs: look in the right subtree for smallest element, put into root/parent. NOTE: May need to call multiple time if smallest has left and right children
The element you are bringing up is the next largest child[find this by looking in the right subtree for the smallest element]
|