Mavzu: Daraxtlarni Prufer usulida kodlash. Daraxtlarni ularning kodi bo'yicha yasash


node * last=new node; node * last=new node


Download 0.83 Mb.
bet7/7
Sana28.12.2022
Hajmi0.83 Mb.
#1019223
1   2   3   4   5   6   7
Bog'liq
Mustaqil ish

node * last=new node;

node * last=new node;

cin>>s;

p->info=s;

p->left=NULL;

p->right=NULL;

if(i==0){tree=p;

next=tree; continue; }

next=tree;while(1)

{ last=next;if(p->infoinfo)

next=next->left;

else next=next->right;

if(next==NULL)break; }


if(p->infoinfo)last >left=p;
else last->right=p;}
cout<
cout<<"\nbinar daraxt:\n";
vizual(tree,0);
AVLtree(tree);
if(GetFlag()) cout<<"ha,
muvozanatlangan daraxt";
else cout<<"yo’q, muvozanatlanmagan daraxt";cout<< i="">getch();}
Dastur natijasi:

E’TIBORINGIZ UCHUN RAXMAT!


Download 0.83 Mb.

Do'stlaringiz bilan baham:
1   2   3   4   5   6   7




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling