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

ДЗ 1, Симиютин Борис, подгруппа 2 #11

Open
wants to merge 2 commits into
base: 01-string-set
Choose a base branch
from

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