you replace said node with the left most child on its right side, or the right most child on its left side. You then delete the child from the bottom that it was replaced with.
Deleting five could yield either a tree with 3 as its root or 18 as its root, depending on which direction you take.
It looks like you got that image from this site: http://www.algolist.net/Data_structures/Binary_search_tree/Removal
It shows the algorithm you want with images too.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…