data structures using constructing binary tree from traversal results we can construct binary tree if we are given at least two traversal results the first traversal must be the in-order traversal and the second can be either pre-order or post-order traversal the in-order traversal result will be used to determine the left and the right child nodesand the pre-order/post-order can be used to determine the root node for exampleconsider the traversal results given belowin-order traversald pre-order traversala herewe have the in-order traversal sequence and pre-order traversal sequence follow the steps given below to construct the treestep use the pre-order sequence to determine the root node of the tree the first element would be the root node step elements on the left side of the root node in the in-order traversal sequence form the left sub-tree of the root node similarlyelements on the right side of the root node in the in-order traversal sequence form the right sub-tree of the root node step recursively select each element from pre-order traversal sequence and create its left and right sub-trees from the in-order traversal sequence look at fig which constructs the tree from its traversal results now consider the in-order traversal dbe fcg fcg and post-order traversal sequences of given binary tree before constructing the binary treeremember that in post-order traversal the root node is the last node rest of the steps will be the same as mentioned figure above fig in-order traversald dbhe fjcg post order traversald dbhe if dbhe hei figure steps to show binary tree huffman' tree huffman coding is an entropy encoding algorithm developed by david huffman that is widely used as lossless data compression technique the huffman coding algorithm uses variablelength code table to encode source character where the variable-length code table is derived on the basis of the estimated probability of occurrence of the source character the key idea behind huffman algorithm is that it encodes the most common characters using shorter strings of bits than those used for less common source characters the algorithm works by creating binary tree of nodes that are stored in an array node can be either leaf node or an internal node initiallyall the nodes in the tree are at the leaf level and store the source character and its frequency of occurrence (also known as weightwhile the internal node is used to store the weight and contains links to its child nodesthe external node contains the actual character conventionallya ' represents following the left