Sobes.tech
Intern — Middle

Implementation of a function to count leaf nodes in a binary search tree

livecode

Task condition

It is necessary to implement a function that determines the number of leaves in a binary search tree. The function takes a pointer to the root element (root) of the BST as an argument and returns the number of leaf nodes.