Skip to content
Snippets Groups Projects
Commit 5bc937cf authored by florian.burgener's avatar florian.burgener
Browse files

Validation exercice 5

parent 79c4a814
No related branches found
No related tags found
No related merge requests found
......@@ -201,6 +201,12 @@ Matrix *quadtree_to_matrix(Node *root) {
// ---
/**
* @brief Looks for the greatest value in all the quadtree.
*
* @param root
* @return int
*/
int quadtree_max(Node *root) {
if (quadtree_is_leaf(root)) {
return root->data;
......@@ -214,6 +220,13 @@ int quadtree_max(Node *root) {
return max_value;
}
/**
* @brief Follows the indicated path, deletes the subtree and initializes the node data to the max of the subtree.
*
* @param root
* @param indices
* @param indices_length
*/
void transform(Node *root, int *indices, int indices_length) {
for (int i = 0; i < indices_length; i += 1) {
root = root->children[indices[i]];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment