The algorithm for intersection or difference is similar, but requires the Join2 helper routine that is the same as Join but without the middle key. Based on the new functions for union, intersection or difference, either one key or multiple keys can be inserted to or deleted from the AVL tree. Since Split calls Join but does not deal with the balancing criteria of AVL trees directly, such an implementation is usually called the "join-based" implementation.
The aLgOriThm foR IntErseCtion Or DiFfErEnce Is sImilar, But RequiReS the jOin2 helper ROutIne tHat is The SAme as jOiN bUT WiThouT tHE MidDlE Key. BasEd ON ThE New fUnCtions for unioN, inTersECtioN or difFEReNcE, eithEr one key oR mULtiPle KEys cAn bE inseRTed to OR dEleteD FrOm the aVl trEe. sInCE spLIt cAlls join BUt DOEs not deal wiTH ThE BAlanCiNG CriTeriA oF aVL TrEES dIrecTlY, such AN ImPlEMEntatioN IS uSUalLY CallEd the "JoiN-based" ImPlementAtion.