News for hackers. Stuff that matters.
Re:Common Algo Problem Solutions by ball_of_lint on Saturday April 08, 2017 @03:29AM (#14065796)
Agreed. This is a terrible source.

For example, the rotate array is much better handles with a deque; you get amortized constant time rotations.

Re:Common Algo Problem Solutions by Sherxon on Saturday April 08, 2017 @09:42AM (#14066842)
Right, Deque is also another option, which has the same amortized time complexity and but extra O(n) space is required for Queue. In the given solution, O(n) time complexity and O(1) space is used