1 / 10

POHON ( lanjutan 3)

POHON ( lanjutan 3). 15. Traversal Pohon m - ary Skema preorder , inorder , dan postorder pada pohon biner dapat dirampatkan sehingga berlaku untuk sembarang pohon m- ary . Traversal preorder , inorder , dan postorder pada m- ary didefinisikan sebagai berikut . 1. Preorder

Download Presentation

POHON ( lanjutan 3)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. POHON (lanjutan 3)

  2. 15. Traversal Pohonm-ary Skemapreorder, inorder, danpostorderpadapohon binerdapatdirampatkansehinggaberlakuuntuksembarangpohonm-ary. Traversal preorder, inorder, danpostorderpada m-arydidefinisikansebagaiberikut. 1. Preorder (i)KunjungiR (ii) KunjungiT1, T2, … , Tnsecarapreorder 2. Inorder (i)KunjungiT1, secarainorder (ii) KunjungiR (iii) KunjungiT2, T3, … , Tnsecarainorder

  3. 3. Postorder (i)KunjungiT1, T2, … , Tnsecarapostorder (ii) KunjungiR Contoh 12 Tentukanhasilkunjungan preorder, inorder, danpostorderdaripohon4-aryberikut!

  4. a d b c e g l m i h j f k preorder : a b e n o f g c h I d j k l p q m postorder : n o e f g b h i c j k p q l m d a inorder : n e o b f g a h c I j d k p l q m o n q p

  5. Tugas 7 Diberikankode Huffman sebagaiberikut: a: 001, b:0001, e: 1, r: 0000, s:0100, t:011, x: 01010 i) Gambarkanpohon Huffman yang mempresentasikan kodetersebut! ii) Decode rangkaian bit berikut: 0111100110100110001001 2. Susunkode Huffman untuk string: MISSISSIPPI

  6. 3. Dari pohonberikut, tentukanhasilpenelusuran secarainorder, preoeder, danpostoeder! A B C E H D F G J L I K O M N P

  7. Penyelesaian: 1.i 0 1 e 0 1 1 0 0 1 a t 1 0 1 0 s r b 0 x 1.ii 011110011 0100 110001001 te eae s eeba

  8. 2 MPIS 11/11 MPSI 11/11 0 1 0 1 atau S 4/11 MPI 7/11 I 4/11 MPS 7/11 0 1 0 1 MP 3/11 S 4/11 MP 3/11 S 4/11 0 0 1 1 M 1/11 P 2/11 M 1/11 P 2/11

  9. atau

  10. 3 A B C E H D F G Inorder D B I E M J N O A F C G K H P L Preorder A B D E I J M N O C F G H K L P Postorder D I M N O J E B F G K P L H C A J L I K O M N P

More Related