in Java, a byte takes up one byte
byte b = 0;
to set bit i to 1
b = b | (1 << i);
to set bit i to 0
b = b & ~(1 << i);
to find out if bit i is 1?
if (b & (1 << i) != 0)
to find out if bit i is =?
if (b & (1 << i) == 0)
assuming binary trees:
preorder traversal: SLR
postorder traversal: LRS
inorder traversal: LSR
No comments:
Post a Comment