IF2030_Proc_12_PohonBiner_bagian1

1 2011 2012 20 contoh printpreorder contoh

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ng } else { Rekurens, tidak kosong } tid Proses(P) PreOrder(Left(P)) PreOrder(Right(P)) 11/22/11 YA/IF2030/Sem. 1 2011-2012 20 Contoh PrintPreOrder Contoh - PrintPreOrder procedure PrintPreOrder (input P : BinTree) { I.S. Pohon P terdefinisi } { F.S. Semua node pohon P sudah dicetak secara PreOrder: akar, kiri, kanan } { Basis : Pohon kosong : tidak ada yang diproses } { Rekurens : Cetak Akar(P); cetak secara Preorder (Left(P)); cetak secara Preorder (Right(P)) } KAMUS LOKAL ALGORITMA if IsTreeEmpty(P) then { Basis-0 } { do nothing } else { Rekurens, tidak kosong } tid output(Akar(P)) PrintPreOrder(Left(P)) PrintPreOrder(Right(P)) 11/22/11 YA/IF2030/Sem. 1 2011-2012 21 Traversal Inorder Traversal - Inorder procedure InOrder (input P : BinTree) { I.S. Pohon P terdefinisi } { F.S. Semua node pohon P sudah diproses secara InOrder: kiri, akar, kanan } { Basis : Pohon kosong : tidak ada yang diproses } { Rekurens : Proses secara inorder (Left(P)); Proses Akar(P); Proses secara inorder (Right(P)) } KAMUS LOKAL ALGORITMA if IsTreeEmpty(P) then { Basis-0 } { do nothing } e...
View Full Document

This document was uploaded on 03/15/2014 for the course IF 2030 at Institut Teknologi Bandung.

Ask a homework question - tutors are online