Skip to content

Conversation

@dominikstrak2001
Copy link
Contributor

No description provided.

@dominikstrak2001 dominikstrak2001 requested a review from a team as a code owner August 10, 2024 16:25

buildTree(0, tree.root.get());
return tree;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add enter

Comment on lines +77 to +87
for (std::uint64_t i = 1; i < nodes; ++i) {
int decision = rnd.intFromRange(0, 99);

if (decision < 70) { // 70% chance to add a single child to the current node (bias towards depth)
current = current->addChild(generateValue());
} else if (decision < 90 && current->parent) { // 20% chance to move back to the parent and add a sibling
current = current->parent->addChild(generateValue());
} else { // 10% chance to add another child to the current node (increasing breadth slightly)
current->addChild(generateValue());
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This generate really special shape of trees

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants