Wolfram Function Repository
Instant-use add-on functions for the Wolfram Language
Function Repository Resource:
Get the successor of a given subset in Gray code order
ResourceFunction["NextGrayCodeSubset"][l,s] gives the successor of s in the list of Gray code subsets of set l. |
In a Gray code, each subset differs by the insertion or deletion of exactly one element:
| In[1]:= |
| Out[1]= |
| In[2]:= |
| Out[2]= |
NextGrayCodeSubset[l,s] gives the successor to s in the list returned by the resource function GrayCodeSubsets:
| In[3]:= |
| In[4]:= |
| Out[4]= |
| In[5]:= |
| Out[5]= |
| In[6]:= |
| Out[6]= |
This work is licensed under a Creative Commons Attribution 4.0 International License