Location:
Search - cartesian tr
Search list
Description: 有一种特殊的二叉树被称为笛卡尔树,这种二叉树的每个结点都有两个关键码,记为key1和key2。现在给你一组关键码,每组关键码用二个整数表示,要求构造一棵同时满足下列两个性质的笛卡尔树:
只考虑这棵笛卡尔树的第一关键码,它是一棵排序二叉树。
只考虑这棵笛卡尔树的第二关键码,它们满足类似于最小堆的性质,即任意一个父结点的第二关键码都比它的子结点的第二关键码小。
-There is a special kind of binary tree is called Cartesian tree, this tree each node has two key code, recorded as key1 and key2. Now give you a key code, key code for each group with two integers that satisfy the requirements of a structural nature of the following two Cartesian tree: only the Cartesian tree of the first key code tree, which is a binary tree sort. Cartesian tree trees only consider the second key code, and they meet the minimum heap similar nature, that is, the father of any of the key node of the second sub-code than it is the second node key code small.
Platform: |
Size: 1024 |
Author: 孙巍巍 |
Hits: