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