-
Notifications
You must be signed in to change notification settings - Fork 14
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
base: 01-string-set
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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); |
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
== root.howMany...
?
There was a problem hiding this comment.
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; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
numberOfChildren
и howManyStartsWithPrefix
как-нибудь связаны?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Действительно, они полностью друг друга дублируют, и от одного поля можно избавиться
No description provided.