Adding Time Complexity analysis