Naithani's blog

By Naithani, history, 4 years ago, In English

I want to iterate on masks such that all combinations of masks with only 1 bit missing first, then all combinations of masks such that 2bits are missing, and so on. This trick I need in TSP and I have used O(2^n) space. Is there any better way to do it in O(1).

Code
  • Vote: I like it
  • 0
  • Vote: I do not like it