Skip to content

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

Open
simiyutin wants to merge 2 commits intojava-course-au:01-string-setfrom
simiyutin:01-string-set
Open

ДЗ 1, Симиютин Борис, подгруппа 2#11
simiyutin wants to merge 2 commits intojava-course-au:01-string-setfrom
simiyutin:01-string-set

Conversation

@simiyutin
Copy link
Copy Markdown

No description provided.

@simiyutin
Copy link
Copy Markdown
Author

@sproshev

Copy link
Copy Markdown

@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);
Copy link
Copy Markdown

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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

== root.howMany...?

Copy link
Copy Markdown
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;
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
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