I need a non recursive algorithm that will add up the root to the tree values, and then display the value that is the highest. Not to add up every element in the tree, just the highest value way to get from root to leaf.
2 / \ 8 6
in this example the answer would be 10 must be in O(n) timing
Try it breadth-first. Add the children of the actual node to a list, then proceed along that list until you reach its end.