Time:
O
(
n
) = log
n
,
(
n
) = log
n
,
(
n
) = log
n
Space:
O
(1)