19年冬季第四题 PAT甲级 1167 Cartesian Tree (30分)超级详解不AC都难
题目:7-4CartesianTree(30分)ACartesiantreeisabinarytreeconstructedfromasequenceofdistinctnumbers.Thetreeisheap-ordered,andaninordertraversalreturnstheoriginalsequence.Forexample,giventhesequence{8,15,3,4,