Till KTH:s startsida Till KTH:s startsida

Morse

There are several standards for Morse codes and we will here use a slightly extended version since we also want to code some special character. The Morse code uses, as you probably know, long and short (often pronounced di and da) to encode characters. You might therefore think that is identical to Huffman codes but there is a difference.

You task is to decode the following messages:

  • ".- .-.. .-.. ..-- -.-- --- ..- .-. ..-- -... .- ... . ..-- .- .-. . ..-- -... . .-.. --- -. --. ..-- - --- ..-- ..- ... "
  • ".... - - .--. ... ---... .----- .----- .-- .-- .-- .-.-.- -.-- --- ..- - ..- -... . .-.-.- -.-. --- -- .----- .-- .- - -.-. .... ..--.. ...- .----. -.. .--.-- ..... .---- .-- ....- .-- ----. .--.-- ..... --... --. .--.-- ..... ---.. -.-. .--.-- ..... .---- "

To spare you the trouble of entering the Morse codes in a table, you are given them in a tree. There is also a skeleton code to get you starting.

This is a tutorial that also describes an encoder.

Teacher Johan Montelius created page 29 January 2015

Teacher Johan Montelius changed the permissions 29 January 2015

Kan därmed läsas av lärare och ändras av lärare.

Teacher Johan Montelius changed the permissions 30 January 2015

Kan därmed läsas av alla och ändras av lärare.

Teacher Johan Montelius changed the permissions 23 January 2017

Kan därmed läsas av lärare och ändras av lärare.

Teacher Johan Montelius changed the permissions 27 January 2017

Kan därmed läsas av alla och ändras av lärare.

Teacher Johan Montelius changed the permissions 19 December 2017

Kan därmed läsas av lärare och ändras av lärare.

Administrator Johan Montelius changed the permissions 26 January 2018

Kan därmed läsas av alla och ändras av lärare.

Administrator Johan Montelius changed the permissions 29 January 2019

Kan därmed läsas av lärare och ändras av lärare.

Administrator Johan Montelius changed the permissions 30 January 2019

Kan därmed läsas av alla och ändras av lärare.