binary trees listing improved implementation of the heapsort algorithm sorts sequence in ascending order using the heapsort def heapsorttheseq ) len(theseqbuild max-heap within the same array for in rangen siftuptheseqi extract each value and rebuild the heap for in rangen- - tmp theseq[jtheseq[jtheseq[ theseq[ tmp siftdowntheseqj- applicationmorse code morse code is type of character encoding originally designed in the late by samuel morse for use with his telegraph system morse code allowed messages to be transmitted long distances across telegraph wires and was extensively used by the american railroad companies it was first used in to transmit messages between washington and baltimore the original code used various patterns of dots and spaces to represent the letters of the alphabet while this was sufficient for use in the united statesthe code could not be used in europe to transmit non-english textwhich contains diacritic marks to remedy this shortcomingfriedrich clemens gerke improved on the original morse code and developed new version that was first used in to transmit messages in germany gerke' version of the codewith minor changeswas standardized in and became known as international morse code the original code developed by samuel morse became known as american morse code the modern international morse code represents various letterssymbolsand digits using sequences of dots (or dits)dashes (or dahs)short gapsand long gaps the short gaps are used to break the sequence between letters and the long gaps are used to separate words the most famous is the sequence for sos--at this pointyou might be wondering why we are discussing morse code and what it has to do with binary trees suppose you are given the following sequenceand would like to know what it means the most obvious way to decode this message is to look through table for each part of the sequence and find the corresponding letter when decoded the message readstrees are fun