Это вопрос интервью. Найдите второй макс в BST.
Максимальный элемент - самый правый лист в BST. Второй макс является либо его родителем, либо его левым дочерним элементом. Таким образом, решение состоит в том, чтобы пересечь BST, чтобы найти самый правый лист и проверить его родительский и левый ребенок.
Имеет ли смысл?