Heya peeps, so i've been asking friends, and been trying for the past day or so, but my ego is at it's lowest. it seems like such an easy and simple thing to code, but every few steps i reach a roadblock and it seems never ending.
Basically my professor challenged me to rewrite the recursive function, GetSum(), that adds all data in a binary tree, but using while loop(s). I am sorry to publicly annouce this on the Java discord server, but I do not use Java that frequently, so my capabilities is somewhat being limited here.
A friend of mine suggested I convert the binary tree to a list or array, and then just add it, but is there a way to avoid converting ? I would rather avoid the professor making excuses that it's not the same as converting a recursive function to a while loop function because i converted the BT.
Help will be GREATLY appreciated !! < 3