結果 : explain time and space complexity of an algorithm with example