Time: O(1), Space: O(1)