binary tree stack and maxpq