Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added huffman code #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

nxnfufunezn
Copy link

@nxnfufunezn nxnfufunezn commented Oct 4, 2018

Fixes #1

Copy link
Member

@Rizzen Rizzen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please check review


public class HuffmanNode : IComparable<HuffmanNode>
{
public long frequency;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please follow the naming guideline

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also please rename "ch" to something more readable, like "character" or "symbol".


public class HuffmanCoding
{
PriorityQueue<HuffmanNode> priorityQueue;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please specify accessibility level explicitly

namespace Algorithms.HuffmanCoding
{

public class HuffmanNode : IComparable<HuffmanNode>
Copy link
Member

@Rizzen Rizzen Oct 4, 2018

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Public class should be placed in a separate file.


[Theory]
[InlineData("abaacaabd", "d", "011")]
[InlineData("aaaaaaaaaaaaaaaaaaaaaaaaaaac", "a", "1")]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In that case code for "a" should be 0, doesn't it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants