updated documentation

added information on space complexity