(1) if no allowable multidimensional cut for partition then
(2)  return  :
(3) else
(4)  
(5)  
(6)  
(7)  
(8)  
(9)  
(10) 
(11)  return  
(12) end if
Algorithm 1: Modified Mondrian algorithm.