data structures using table range of characters that can be coded using code character table range of characters that can be coded using data coding when we want to code our data (characterusing bitsthen we use bits to code characters for exampleif = then two characters can be coded if these two characters are and bthen can be coded as and can be coded as and vice versa look at tables and which show the range of characters that can be coded by using = and = nowif we have to code the data string abbbbbbaaaacdefgggghthen the corresponding code would be this coding scheme has fixed-length code because every character is being coded using the same number of bits although this technique of coding is simplecoding the data can be made more efficient by using variable-length code you might have observed that when we write text in englishall the characters are not used frequently for examplecharacters like aeiand are used more frequently than wxyz and so on sothe basic idea is to assign shorter code to the frequently occurring characters and longer to less frequently occurring characters variable-length coding is preferred over fixed-length coding because it requires lesser number of bits to encode the same data for variable-length encodingwe first build huffman tree firstarrange all the characters in priority queue in which the character with the lowest frequency of occurrence has the highest priority thencreate huffman tree as explained in the previous section figure shows huffman tree that is used for encoding the data set in the huffman treecircles contain the cumulative weights of their child nodes every left branch is coded with and every right branch is coded with sothe characters aerwxyand are coded as shown in table code character table characters with their codes character code figure huffman tree thuswe see that frequent characters have shorter code and infrequent characters have longer code applications of trees trees are used to store simple as well as complex data here simple means an integer valuecharacter value and complex data means structure or record