I am currently working on a project for my Data Structures Course that involves a Binary Search Tree built using a doubly linked list-type format (where each node has a left, right, and parent pointer). The class managing the tree also has a root pointer and a current pointer (like a cursor).
One of the functions I need to build calculates the standard deviation of the entire tree. Unfortunately, I'm getting stuck on how to approach this function without using a standard library container (It's heavily discouraged within the course). I understand how to get the sum of the entire tree, but being able to access each number individually to compute the standard deviation is what is confusing me (since I can not store the tree as an array and access the contents sequentially.
Please forgive me if this is a basic question or I am missing some obvious approach. I tend to struggle with data structure concepts and especially when it comes to recursion. I'm not requesting someone to write the function, but at least to point me in the right direction. Thank you!
Edit: Thank you trincot for your help, I was thinking of the method the wrong way but your explanation helped!