Skip to content

Conversation

@simiyutin
Copy link

No description provided.

@simiyutin
Copy link
Author

@sproshev

Copy link

@sproshev sproshev left a comment

Choose a reason for hiding this comment

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

10

final int size = 7;
assertTrue(stringSet.size() == size);

assertTrue(stringSet.howManyStartsWithPrefix("i") == 2);

Choose a reason for hiding this comment

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

см assertEquals, в случае несовпадения он распечатает оба значения


public class StringSetImpl implements StringSet {

private int size;

Choose a reason for hiding this comment

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

== root.howMany...?

Copy link
Author

Choose a reason for hiding this comment

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

Да, и size тут не нужен

private Node[] children;
private char value;
private int numberOfChildren;
private int howManyStartsWithPrefix;

Choose a reason for hiding this comment

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

numberOfChildren и howManyStartsWithPrefix как-нибудь связаны?

Copy link
Author

Choose a reason for hiding this comment

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

Действительно, они полностью друг друга дублируют, и от одного поля можно избавиться

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.

2 participants