Bit operations visual mnemonics:
Operation | Calculation | Mnemonic |
---|---|---|
GET bit i | n&(1<<i) | nacicci (拿 ná) |
SET bit i | n|(1<<i) | nicicci ("knee") |
CLR bit i | n&~(1<<i) | nancicci ("none") |
CLR (MSB to bit i) | n&((1<<i)-1) | nacciccimi |
CLR (bit i to LSB) | n&(-1<<(i+1)) | nacmiccipi |
UPDATE bit i | n&~(1<<i) | (1<<i) | nancicci icicci |
BFS visual mnemonic:
Heap visual mnemonic:
More visual mnemonics: here.