TIME COMPLEXITY

Worst case:

Average case:

Best case:

SPACE COMPLEXITY

Worst case: