I tried finding the total number of values in a 2-3 tree using inorder traversal and instead of printing the values in the node, I tried incrementing the initalised int value everytime there is a value; however, this method didn't seem to work.
Is there a more efficient way to count the total number of values in a 2-3 tree?