SHARE
TWEET

Untitled

a guest Sep 16th, 2019 89 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. def getCharCode(tree: HuffmanCodingTree, code: List[Int]): (Char, List[Int]) = (tree, code) match {
  2.     case (tr, x :: xs) if tr.chars.length == 1 => (tr.chars.head, xs)
  3.     case (tr, x :: xs) if x == 0 => getCharCode(tr.asInstanceOf[HuffmanCodingTreeNonLeaf].leftChild, xs)
  4.     case (tr, x :: xs) if x == 1 => getCharCode(tr.asInstanceOf[HuffmanCodingTreeNonLeaf].leftChild, xs)
  5.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top