Time Complexity In Sorted Python