Empresa engajada
Given the root of a binary search tree along with a node inside it, find the successor node for the given one.
Sigiloso
In a BST the predecessor is the right-most leaf of the left child and the successor is the left-most leaf of the right child.
And what if there is no right child..? in that case its the parent... So you need to handle both cases..
Fique por dentro de todas as oportunidades e dicas internas seguindo as empresas de seus sonhos.
Comece a buscar vagas para receber atualizações e recomendações personalizadas.