Skip to main content
. Author manuscript; available in PMC: 2021 Nov 10.
Published in final edited form as: Stat Interface. 2019 Mar 11;12(2):283–293. doi: 10.4310/sii.2019.v12.n2.a9
Algorithm 2 rpTree(D)
1:LetDbe the root node of treet;2:Initialize the set of working nodesW{D};3:whileWis not emptydo4:Randomly pickWWand setWW{W};5:ifW<nsthen6:Skip to the next round of the while loop;7:endif8:Generate a random liner;9:Project points inWontor,letM={Pr(w):wW};10:Leta=min(M)andb=max(M);11:Generate a splitting pointsuniformly over interval[a,b];12:Split nodeWbyWL={a:Pr(a)<s}andWR={a:Pr(a)s};13:W.leftWLandW.rightWR;14:Update the working set byWW{WL,WR};15:endwhile16:return(t);