Re:Data structures and algorithms problems in C++ using STL
by throwaput on Friday March 10, 2017 @01:11PM
(#13840673)
Even for power of two it's not correct, forget my statement about cycles.
[ Parent
| on HN ]
Re:Data structures and algorithms problems in C++ using STL
by throwaput on Friday March 10, 2017 @01:22PM
(#13840758)
Yet I have only one idea - that we can permute the elements somehow (in a O(1) reversible way like a Gray code) so that the cycles would form something computable in O(n) time and O(1) space