Is the given node red as opposed to black? To prevent having an extra word in the data array, we just the low bit on the left child index.
(int position)
| 69 | * in the data array, we just the low bit on the left child index. |
| 70 | */ |
| 71 | protected boolean isRed(int position) { |
| 72 | return position != NULL && |
| 73 | (data.get(position * ELEMENT_SIZE + LEFT_OFFSET) & 1) == 1; |
| 74 | } |
| 75 | |
| 76 | /** |
| 77 | * Set the red bit true or false. |