| 885 | // |
| 886 | |
| 887 | bool pq_tree::P1(p_node* x, bool is_root) |
| 888 | { |
| 889 | if (x->child_count == x->full_count) { |
| 890 | if (!is_root) { |
| 891 | x->father->full(x->pos); |
| 892 | } |
| 893 | else { |
| 894 | pert_root = x; |
| 895 | } |
| 896 | |
| 897 | x->sons.splice(x->sons.end(), x->full_sons.begin(), |
| 898 | x->full_sons.end()); |
| 899 | x->clear(); |
| 900 | return true; |
| 901 | } |
| 902 | |
| 903 | return false; |
| 904 | } |
| 905 | |
| 906 | |
| 907 | //----------------------------------------------------------------------- P2 |