C++ Program to develop a Huffman Tree

  • Tình trạng: Closed
  • Giải thưởng: $25
  • Các bài thi đã nhận: 2
  • Người chiến thắng: iit2009013

Tóm tắt cuộc thi

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.

Các kĩ năng yêu cầu

Bảng thông báo công khai

  • iit2009013
    iit2009013
    • cách đây 11 năm

    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.

    • cách đây 11 năm
    1. ysrikanth3000
      Chủ cuộc thi
      • cách đây 11 năm

      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???

      • cách đây 11 năm
  • it2051229
    it2051229
    • cách đây 11 năm

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

    • cách đây 11 năm
    1. it2051229
      it2051229
      • cách đây 11 năm

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

      • cách đây 11 năm
    2. it2051229
      it2051229
      • cách đây 11 năm

      *don't do contests

      • cách đây 11 năm
  • Ruchi003
    Ruchi003
    • cách đây 11 năm

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

    • cách đây 11 năm
    1. ysrikanth3000
      Chủ cuộc thi
      • cách đây 11 năm

      yes

      • cách đây 11 năm
  • umarmughal824
    umarmughal824
    • cách đây 11 năm

    I can do it very easily within your given time.

    • cách đây 11 năm
  • PeinOS
    PeinOS
    • cách đây 11 năm

    Hello, I can do this task

    • cách đây 11 năm
  • rishu2231
    rishu2231
    • cách đây 11 năm

    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 )

    • cách đây 11 năm
    1. ysrikanth3000
      Chủ cuộc thi
      • cách đây 11 năm

      ok but let me know the project amount @rishu2231

      • cách đây 11 năm
  • Venky117
    Venky117
    • cách đây 11 năm

    hi... i can do this ASAP.

    • cách đây 11 năm
  • ysrikanth3000
    Chủ cuộc thi
    • cách đây 11 năm

    tell me the amount how much u will charge for it

    • cách đây 11 năm
  • umarbsse
    umarbsse
    • cách đây 11 năm

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

    • cách đây 11 năm
    1. ysrikanth3000
      Chủ cuộc thi
      • cách đây 11 năm

      ok can u tell me the project amount

      • cách đây 11 năm
  • Imranceo
    Imranceo
    • cách đây 11 năm

    I can do this if you award me project thanks

    • cách đây 11 năm

Xem thêm bình luận

Làm thế nào để bắt đầu với cuộc thi

  • Đăng cuộc thi của bạn

    Đăng cuộc thi của bạn Nhanh chóng và dễ dàng

  • Nhận được vô số bài dự thi

    Nhận được vô số Bài dự thi Từ khắp nơi trên thế giới

  • Trao giải cho bài thi xuất sắc nhất

    Trao giải cho bài thi xuất sắc nhất Download File - Đơn giản!

Đăng cuộc thi ngay hoặc tham gia với chúng tôi ngay hôm nay!