EXEMPLO DE REMOÇÃO ARVORE 5 24 3 68 7. if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then.

Slides:



Advertisements
Similar presentations

Advertisements

Empirical Formulas Compare the following compounds: HgO vs. Hg 2 O 2 C 2 H 6 vs. C 4 H 12 Empirical Formulas: Lowest-ratio formulas What do the subscripts.
Árvore de Decisão > x library(rpart) > arvore
VHDL.
1. 2 Memória (R-bit register) Circuito Combinatório D1D1 DRDR TRTR T1T1 X1X1 XLXL Y1Y1 YNYN clockreset MEF.
Forma de Trabajo 3 – Plantear todas las estrategias posibles 4 – Seleccionar la más adecuada (Método de ordenamiento por Selección)
James Tam Linked Lists in Pascal Linked Lists In this section of notes you will learn how to create and manage a dynamic list.
Introdução a Programação COM 100 Aula 08 Procedimentos.
POSSESSIVE ADJECTIVES AND PRONOUNS USOS: A- POSSESSIVE ADJECTIVES Obrigatoriamente antes de substantivos, precedidos ou não de adjetivos. Ex.: HER parents.
Selection Process If … then … else.... Condition Process 2 Process 1 Y.
MAIN BODY OF PROGRAM DECLARATION ACTION
Naredba If..Then..Else... Procedure TForm1.Button1Click ( SEnder: Tobject ); Var x, y, Max : Integer; Begin x := StrToInt ( Edit1.Text ); y := StrToInt.
Selection If Flowchart A diagram that shows step-by-step progression through a procedure or system especially using connecting lines and a set of conventional.
Info 3.3. Chapter 3.3 Recursive Data Structures Part 2 : Binary Trees.
Chapter 2.5 Modula 2 Control Instructions. Modula 2 Control Statements Selection statements –BOOLEAN Selector : IF statement –Ordinal Selector : CASE.
CHREK Marcos Aurélio MSN:
C h e m i c a l R e a c t i o n s. C h e m i c a l R e a c t i o n A p r o c e s s i n w h i c h o n e s u b s t a n c e i s c h a n g e d i n t o a n.
M5 - 09/02/2012 M4 - 09/02/ V ; 0.010nA. M8 - 09/02/2012 M9 - 09/02/ V ; 0.15nA1.8V ; 0.21nA.
1/03/09 De 89 à 98. 1/03/09 De 89 à 98 1/03/09 De 89 à 98.
A) 80 b) 53 c) 13 d) x 2 = : 10 = 3, x 3 = 309.
James Tam Pointers In this section of notes you will learn about another type of variable that stores addresses rather than data.
J. Michael Moore Scope & Testing Modules CSCE 110 Influenced by material developed by James Tam & Jennifer Welch.
James Tam Pointers In this section of notes you will learn about another type of variable that stores addresses rather than data.
James Tam Pointers In this section of notes you will learn about a third type of variable that stores addresses rather than data.
James Tam Pointers In this section of notes you will learn about another type of variable that stores addresses rather than data.

Объекты - списки unit List; interface type TElem = class public p: TElem; s: integer; constructor Create(r: TElem); function Len: integer; function Sum:
“CAN” FOR PERMISSION book: unit 13, p. 89. USAMOS O VERBO MODAL CAN (PODER) PARA PEDIR PERMISSÃO EM FRASES INTERROGATIVAS. O VERBO PRINCIPAL SEMPRE FICARÁ.
Array : 1-dimension อนันต์ ผลเพิ่ม Anan Phonphoem
Looping(1) For … to … do... Can you do this? Write a program to display:
。 33 投资环境 3 开阔视野 提升竞争力 。 3 嘉峪关市概况 。 3 。 3 嘉峪关是一座新兴的工业旅游城市,因关得名,因企设市,是长城文化与丝路文化交 汇点,是全国唯一一座以长城关隘命名的城市。嘉峪关关城位于祁连山、黑山之间。 1965 年建市,下辖雄关区、镜铁区、长城区, 全市总面积 2935.
Line complète de production de Fromage.
MAN versus Off-peak Background Measurements
Design responsivo.
Warm-Up Ch3 #4 Gr 6.
Procedure To Remove AVG From isearch.
Calculations with Equations
Потпрограми во Pascal.
A Very Brief Overview of Pascal
Limiting Reactants.
Balancing Chemical Equations
Көңіл күйлеріңіз қалай?
DH = qp Internal Energy, E Enthalpy, H H = E + PV = + q w heat + _
Бірөлшемді жиымдар Паскаль тілінде бағдарламалау
Ch. 5 - Ionic Compounds.
تهیه و تنظیم: فاطمه قاسمی دانشگاه صنعتی شریف – پاییز 86
Limiting Reactants.
kbkjlj/m/lkiubljj'pl;
Resolución de problemas y algoritmos
Trends in groups and rows; Balanced and unbalanced equations
Електромагнитно лъчение: природа, характеристики
Паскаль тілінің басқару
Қайталау операторлары
9 сынып 8 сабақ Сабақтың тақырыбы: Дейін циклі REPEAT операторы.
Computer Science 2 More Trees.
Post Lab: FlashBulbs & Mole Ratios
x > Array.new(5) [nil, nil, nil, nil, nil] > x = Array.new(5)
Computer Science 2 Queue.
STOICHIOMETRY REVIEW.
Limiting Reagents Problem: Find the amount of cakes we can make when we have 4 sticks of butter and 50 cups of flour. 1 Butter + 2 Flour -> 1 Cake We.
Computer Science 2 Queue Day 2.
Limiting Reactants.
Calculate 81 ÷ 3 = 27 3 x 3 x 3 3 x 3 x 3 x 3 ÷ 3 = This could be written as
LINEAMIENTOS PARA LA FORMACION DE EQUIPOS CARACTERISTICAS.
10/4 Introduction 11/1 Ch. 1 Punitive or Restorative
Computer Science
Hair Removal Methods: What's Effective and What's Not.
Introduction Procedures Results Conclusion Methods References

Presentation transcript:

EXEMPLO DE REMOÇÃO ARVORE

if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=5 if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=3 if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=2 ROTINA PARA REMOVER O ELEMENTO 2 ELEMENTO 2 REMOVIDO

if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=5 if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=3 if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=4 ROTINA PARA REMOVER O ELEMENTO 4 ELEMENTO 4 REMOVIDO

if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=5 if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=3 if (T = nil) then begin writeln ('ELEMENTO NAO ENCONTRADO NA ARVORE'); end else begin if (X.ch < T^.elem.ch) then begin remove (T^.esq, X); end else begin if (X.ch > T^.elem.ch) then begin remove (T^.dir, X); end else begin if (T^.dir = nil) then begin A := T; T := T^.esq; dispose(A); end else begin if (T^.esq=nil) then begin A := T; T := T^.dir; dispose(A); end else begin Maior (T^.esq,X); T^.elem := X ; remove (T^.esq,X ); end; T=2 procedure maior (Q:arvore; var R:Telemento); begin while Q^.dir <> nil do begin Q:= Q^.dir; end; R:= Q^.elem; end; T=2 ROTINA PARA REMOVER O ELEMENTO 3 ELEMENTO 3 REMOVIDO