You are viewing a single comment's thread. Return to all comments →
with only adds and bitwise:
return ~(~1<<(n>>1)) << n%2;
Utopian Tree
You are viewing a single comment's thread. Return to all comments →
with only adds and bitwise:
return ~(~1<<(n>>1)) << n%2;