結果 : explain time complexity and space complexity of an algorithm with the help of a suitable example