small changes complexity

added alternative total complexity, fixed a typo in previous total space
complexity