Is it a bad practice to temporarily mutate function parameters assuming non-concurrency?

Spoiler Alert: Description below contains a spoiler for Problem 234.

In some algorithms we can significantly improve performance by temporarily mutating inputs. In Palindrome Linked List, for example, we can reverse the links in one half of the linked list and reverse them back once we've solved the problem. With this trick the algorithm uses O(1) space instead of O(n). If we assume that no concurrent operations will be done on that list, is that still considered a bad practice, given the mutation is only temporary?

Comments (1)