Find Longest path in tree, C++ coursework