15
W7L1. Trees Reference book: Discrete Mathematics. K.Rosen

t ó> í X d...NILE UNIVERSITY OF NIGERIA ga ka Sl IYU faM0 ua hhM MED doRO ztABD 1M NDS abA ED DIRI IMA NU cvE DA OO.R.R. eGU MAN MAD ma S ALAM sbMlJ IBU 00 Sl alBEXAMPLE 1 Which

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

W7L1.Trees

Reference book: Discrete Mathematics. K.Rosen

Real life graph application

Trees

Root

Parent * Child * Siblings * Ancestors * Descendants * Leaf * Internal vertex * Sub-tree

Parent Child

m-ary tree

Applications of tree

Binary decision tree

Decision Tree – Fake Coin

Decision Tree – Compare 3 numbers

Huffman Codingaaaaaaaabbbbbbbbbbccccccccccccdddddddddddddddeeeeeeeeeeeeeeeeeeeefffffffffffffffffffffffffffffffffff

A:8, B:10, C:12, D:15, E:20, F:35 8it x 100 =800bit

A: 111 B: 110C: 011 D: 010 E: 10 F: 00

Calculation the size of message

A:8, B:10, C:12, D:15, E:20, F:35

A: 111 B: 110C: 011 D: 010 E: 10 F: 00

A: 3bit x 8 =24bitsB: 3bit x 10 = 30bitsC: 3bit x 12 = 36bits D: 3bit x 15 = 45bitsE: 2bit x 20 = 40bits F: 2bit x 35 = 70bits

Total 245 bits <<< 800bits