C++ Program to develop a Huffman Tree

  • État: Closed
  • Prix: $25
  • Propositions reçues: 2
  • Gagnant: iit2009013

Résumé du concours

Write a C++ program to develop a Huffman Tree. First you must prompt the user to enter up to 10 letters (from a to z) and the frequency for each letter (the total sum of the frequencies add up to 100). Then create a node for each letter using a struct called node (you must determine what the data types are).

Struct node {
to be implemented………….
}

Insert the nodes of each character into a MinHeap (in class we defined the class MaxHeap, thus use the same class but make sure you change the inequalities from ≤ to ≥ or vice versa) where minimality is with respect to the frequency. The heap is an array of nodes.

1) Delete the first 2 nodes from the heap (using the delete function of the heap class) and create another node where the frequency of the node is the sum of the frequencies of the deleted nodes.
Set address of the new node as the address determined by the new operator.
Add the address of the father node to the deleted nodes. Also set child = ‘L’ for the first deleted node and “R” to the second deleted node.

Repeat step 1) until the heap is empty (remember at the end the final node must have frequency equals to100 and this node is the Huffman tree).

Thus the final Huffman tree looks like the tree in Fig 1.

To determine the code for each letter, starting at the node corresponding to a letter, trace back to the root, and if a node is the leftchild of another node add a 0 to the code and add a 1 otherwise (in reverse order), and go to the father node until the root is reached.

I have attached project details for your reference.

Compétences recommandées

Tableau de clarification publique

  • iit2009013
    iit2009013
    • il y a 11 ans

    I already have a code developed for this. My code displays the frequency of each character, codes generated for each character and finally the decoded word. It also has the option to decode the encoded codeword. I can it to you immediately for $25. Let me know if interested.

    • il y a 11 ans
    1. ysrikanth3000
      Titulaire du concours
      • il y a 11 ans

      As mentioned in the Project description, the sum of frequencies to the given string must be 100. can you please do that modification in the code???

      • il y a 11 ans
  • it2051229
    it2051229
    • il y a 11 ans

    Already did this. Let me know if you are interested.

    • il y a 11 ans
    1. it2051229
      it2051229
      • il y a 11 ans

      The things is I don't do contents in freelancer.com I do projects as awarded.

      • il y a 11 ans
    2. it2051229
      it2051229
      • il y a 11 ans

      *don't do contests

      • il y a 11 ans
  • Ruchi003
    Ruchi003
    • il y a 11 ans

    do you want graphical representation of the heap?
    like in the file?

    • il y a 11 ans
    1. ysrikanth3000
      Titulaire du concours
      • il y a 11 ans

      yes

      • il y a 11 ans
  • umarmughal824
    umarmughal824
    • il y a 11 ans

    I can do it very easily within your given time.

    • il y a 11 ans
  • PeinOS
    PeinOS
    • il y a 11 ans

    Hello, I can do this task

    • il y a 11 ans
  • rishu2231
    rishu2231
    • il y a 11 ans

    i will complete this project with in 24 hours .....
    currently, i am working as Asst Prof in Engineering college.
    Sandeep Srivastava
    M.tech in Computer science.

    http://www.secs.ac.in/faculty.html
    you can see.
    online on freelancer at 9:00 am to 4:00pm and then 9:00 PM to 11:30pm (indian time )

    • il y a 11 ans
    1. ysrikanth3000
      Titulaire du concours
      • il y a 11 ans

      ok but let me know the project amount @rishu2231

      • il y a 11 ans
  • Venky117
    Venky117
    • il y a 11 ans

    hi... i can do this ASAP.

    • il y a 11 ans
  • ysrikanth3000
    Titulaire du concours
    • il y a 11 ans

    tell me the amount how much u will charge for it

    • il y a 11 ans
  • umarbsse
    umarbsse
    • il y a 11 ans

    Go to my profile and invite me i can do that task within 24 hours

    • il y a 11 ans
    1. ysrikanth3000
      Titulaire du concours
      • il y a 11 ans

      ok can u tell me the project amount

      • il y a 11 ans
  • Imranceo
    Imranceo
    • il y a 11 ans

    I can do this if you award me project thanks

    • il y a 11 ans

Montrer plus de commentaires

Comment commencez des concours

  • Publiez votre concours

    Publiez votre concours Rapide et facile

  • Obtenez des tonnes de propositions

    Obtenez des tonnes de propositions De partout dans le monde

  • Attribuez la meilleure proposition

    Attribuez la meilleure proposition Télécharger les fichiers - Facile !

Publier un concours maintenant ou rejoignez-nous maintenant !