Keep pointer to previous branch node parent

Add method checking type of branch node's child
Update previous parent pointer only when leaf node was reached