P-Tree Maximum Algorithm