новый текстовый документ.txt

  • Uploaded by: dddd
  • 0
  • 0
  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View новый текстовый документ.txt as PDF for free.

More details

  • Words: 140
  • Pages: 2
Program P130; uses crt; type Arbore=^Nod; Nod=record Info : integer; St, Dr : Arbore end; var T : Arbore; {radacina } r:integer; s:integer; function Arb : Arbore; {crearea arborelui binar } var R : Arbore; s : integer; begin readln(s); if s=0 then Arb:=nil else begin new(R); R^.Info:=s; write('Dati descendentul sting al nodului ', s, ':'); R^.St:=Arb; write('Dati descendentul drept al nodului ', s, ':'); R^.Dr:=Arb; Arb:=R; end; end; {Arb }

procedure AfisArb(T : Arbore; nivel : integer); {afisarea arborelui binar } var i : integer; begin if T<>nil then begin AfisArb(T^.St, nivel+1); for i:=1 to nivel do write(' '); writeln(T^.Info); AfisArb(T^.Dr, nivel+1); end; end; {AfisareArb } Function inaltime(T : Arbore; nivel : integer):integer; var i : integer; k:integer; begin k:=0; for i:=1 to nivel do k:=k+1; inaltime:=k; end;

begin writeln('Dati radacina:'); T:=Arb; AfisArb(T, 0); readln; s:=inaltime; writeln('inaltimea este:',s); end.

Related Documents

Txt
August 2019 22
Txt
May 2020 13
Txt
April 2020 48
Txt
November 2019 24
Txt
August 2019 21
Txt
November 2019 14

More Documents from ""

November 2019 5
July 2020 2
July 2020 3