You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
implement cbt_visit_all() function that takes a pointer to a function and call this function on all the objects in all the nodes of the tree.
Method
The function will traverse the whole tree starting from the root until it reaches all the leaves and will call the visitor function on all the objects saves in the nodes of the tree.
Prototype
/**
* crabtree_t* , void (*) (void *) -> void
* EFFECTS: Calls the visitor function on every object pointer stored in the tree
* MODIFIES: cranbtree.objects
* REQUIRES: The visitor function to take a void* as an argument and to return nothing
* PARAMETERS:
* - cranbtree_t* cbt: the tree to be traversed
* - void (* visitor) (void *): the function that will be invoked on every object in the tree
*/
void cbt_visit_all(cranbtree_t* cbt, void (* visitor) (void *))
Task
implement cbt_visit_all() function that takes a pointer to a function and call this function on all the objects in all the nodes of the tree.
Method
The function will traverse the whole tree starting from the root until it reaches all the leaves and will call the visitor function on all the objects saves in the nodes of the tree.
Prototype
Where to code
Tests
The text was updated successfully, but these errors were encountered: