Insert a new node into the data array, growing the array as necessary. @return Returns the position of the new node.
(int left, int right, boolean isRed)
| 50 | * @return Returns the position of the new node. |
| 51 | */ |
| 52 | private int insert(int left, int right, boolean isRed) { |
| 53 | int position = size; |
| 54 | size += 1; |
| 55 | setLeft(position, left, isRed); |
| 56 | setRight(position, right); |
| 57 | return position; |
| 58 | } |
| 59 | |
| 60 | /** |
| 61 | * Compare the value at the given position to the new value. |