So I'm looking over some code I found in relation to a project I'm working on for school and I found a function implementation that has private before the return value and I was hoping someone could explain its purpose and use to me. I haven't been able to find anything about it online, possibly because I'm not entirely sure how to pose the question without being redirected to info about private in class definitions or basic function definitions.
private Node insert(Node h, Key key, Value val)
{
if(h == null)
return new Node(key, val, RED);
if(isRed(h.left) && isRed(h.right))
colorFlip(h);
int cmp = key.compateTo(h.key);
if(cmp == 0) h.val = val;
else if(cmp < 0)
h.left = insert(h.left, key, val);
else
h.right = insert(h.right, key, val);
if(isRed(h.right))
h = rotateLeft(h);
if(isRed(h.left) && isRed(h.left.left))
h = rotateRight(h);
return h;
}
This is in regards to left-leaning-red-black-trees. Thanks in advance.