Rotate an Array in Swift

If you have every sat an interview, you would have been introduced to puzzles or questions, that check for how well you solve a problem. The interesting side to all of this is that you are offered the choice of any language, however it is still dependent on the interviewer. It is their understanding and choice of languages that determine the solution. So a solution is all about what they are expecting. Here is a detailed article on how to rotate an array in swift (in-place) which keeps to the O(n) complexity and also keeping with not incurring a memory overhead by allocating new memory.


The article can be found at http://swift.oz-apps.com/2017/03/rotate-an-array-in-place/

Comments

Popular Posts