算法1-20答案.docxVIP

  • 0
  • 0
  • 约3.23万字
  • 约 41页
  • 2017-06-24 发布于河南
  • 举报
算法1-20答案

.把二元查找树转变成排序的双向链表题目:输入一棵二元查找树,将该二元查找树转换成一个排序的双向链表。要求不能创建任何新的结点,只调整指针的指向。???? 10?? / /? 6? 14/ / / /4? 8 12 16??转换成双向链表4=6=8=10=12=14=16。首先我们定义的二元查找树节点的数据结构如下:struct BSTreeNode{? int m_nValue; // value of node? BSTreeNode *m_pLeft; // left child of node? BSTreeNode *m_pRight; // right child of node};//引用 245 楼 tree_star 的回复#include stdio.h#include iostream.hstruct BSTreeNode{??? int m_nValue; // value of node??? BSTreeNode *m_pLeft; // left child of node??? BSTreeNode *m_pRight; // right child of node};typedef BSTreeNode DoubleList;DoubleList * pHead;DoubleList * pListIndex;void convertToDouble

文档评论(0)

1亿VIP精品文档

相关文档