?? 7-4.c
字號(hào):
#include "stdio.h"
typedef char Datatype;
typedef struct threaded_tree *pt_threaded;
typedef struct threaded_tree {
short int left_thread;
pt_threaded left_child;
Datatype data;
pt_threaded right_child;
short int right_thread;
};
pt_threaded succ( pt_threaded tree)
{ //在樹中找到結(jié)點(diǎn)的中序前驅(qū)
pt_threaded temp;
temp = tree->right_child;
if ( !tree->right_thread )
while( !temp->left_child )
temp = temp->left_child;
return temp;
}
void inorder(pt_threaded tree)
{ //中序遍歷線索二叉樹
pt_threaded temp=tree;
for(; ;){
temp = succ (temp);
if (temp = tree) break;
printf ("%3c", temp->data);
}
}
void main()
{
pt_threaded p;
inorder(p);
}
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -