Python String Indexing Time Complexity Of Binary Trees