public class AddNodeRandom extends TreeMutationAbstract
changedAtLastCall, locationOfLastChange, MAXTRIES, registry, typeOfChange
Constructor and Description |
---|
AddNodeRandom(CentralRegistry registry) |
Modifier and Type | Method and Description |
---|---|
boolean |
changedAtLastCall()
Returns true if the last call of the algorithm caused changes to the tree
|
int |
locationOfLastChange()
Returns the node closest to where the change was made (e.g.
|
NAryTree |
mutate(NAryTree tree)
Calls mutate(Node) on the root and makes sure that the changed node
becomes the new root
|
NAryTree |
mutate(NAryTree tree,
int node)
Mutates the given node (only use if you need to mutate a specific sub
tree, not beeing the whole tree).
|
didChange, getKey, noChange
public AddNodeRandom(CentralRegistry registry)
public NAryTree mutate(NAryTree tree)
TreeMutationAbstract
mutate
in class TreeMutationAbstract
public NAryTree mutate(NAryTree tree, int node)
TreeMutationAbstract
mutate
in class TreeMutationAbstract
node
- Node to mutate onTreeMutationAbstract#mutate(Node)
public boolean changedAtLastCall()
TreeMutationAbstract
changedAtLastCall
in class TreeMutationAbstract
public int locationOfLastChange()
TreeMutationAbstract
locationOfLastChange
in class TreeMutationAbstract