左倾树(LeftistTree)知识讲稿.pptVIP

  • 22
  • 0
  • 约1.54千字
  • 约 22页
  • 2018-11-29 发布于天津
  • 举报
左倾树(LeftistTree)知识讲稿.ppt

左傾樹(Leftist Tree);shortest(x);左傾樹定義;公式;最小左傾樹(min-leftist tree) (或最大左傾樹(max-leftist tree));Combine的步驟;C;C;void min-union(leftist_tree *a, leftist_tree *b){ /*recursively combine two nonempty min leftist trees*/ leftist_tree temp; /*set a to be the tree with smaller root*/ if((*a)-data.key (*b)-data.key){ SWAP(*a,*b,temp);} /*create binary tree such that the smallest key in each subtree is the root*/ if(!(*a)-right_child){ (*a)-right_child = *b; }else{ min_union((*a)-right_child,b);} /*leftist tree property*/ if(!(*a)-left_child){ (*a)-left_child = (*a)-right_child; (*a)-rig

您可能关注的文档

文档评论(0)

1亿VIP精品文档

相关文档