We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
  • Practice
  • Certification
  • Compete
  • Career Fair
  • Hiring developers?
  1. Practice
  2. Data Structures
  3. Trees
  4. Tree: Huffman Decoding
  5. Discussions

Tree: Huffman Decoding

Problem
Submissions
Leaderboard
Discussions
Editorial

    You are viewing a single comment's thread. Return to all comments →

  • Lecron
    5 years ago+ 0 comments

    void decode_huff(node * root,string s) { node * ptr; int n;

    ptr = root;
    for(n=0;s[n];n++)
    {
        ptr = (s[n] == '0') ? ptr->left : ptr->right;
        if(ptr->data)
        {
            cout << ptr->data;
            ptr = root;
        }
    }
    

    }

    12|
    Permalink
  • Contest Calendar
  • Blog
  • Scoring
  • Environment
  • FAQ
  • About Us
  • Support
  • Careers
  • Terms Of Service
  • Privacy Policy
  • Request a Feature