• I Cast Fist@programming.dev
    link
    fedilink
    English
    arrow-up
    25
    arrow-down
    1
    ·
    1 year ago

    I never realized morse code was organized as a binary tree, this makes it much faster to figure out which letter the code meant

    • Deconceptualist@lemm.ee
      link
      fedilink
      English
      arrow-up
      28
      ·
      edit-2
      1 year ago

      I think if you take any set of symbols and map each one to a unique binary sequence, you can then structure it as a binary tree.

      In other words Morse didn’t have to be designed as a tree. The tree is just a data structure that fits any similar abstraction. You could probably do something similar with a multidimensional array (5D to include punctuation) but that’s much harder to illustrate.

      • HamsterRage@lemmy.ca
        link
        fedilink
        English
        arrow-up
        8
        ·
        1 year ago

        Yes, but it is designed that way so that the most common letters take less dits and dad’s to encode. That reduces the overall work.

    • SkyeStarfall@lemmy.blahaj.zone
      link
      fedilink
      English
      arrow-up
      5
      ·
      1 year ago

      Well, you only got 2 symbols, so binary, and you want to minimize the symbols used for the whole alphabet+numbers. That naturally will give you a binary tree.