Added a discussion on time complexities.