Skip to content

Conversation

@Tiloaria
Copy link
Owner

No description provided.

@@ -0,0 +1,2 @@
#Tue Nov 14 16:51:37 MSK 2017
Copy link
Collaborator

Choose a reason for hiding this comment

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

папку .gradle не нужно выкладывать, я вроде бы про это писал уже
-0.5


import static org.junit.Assert.*;

public class MindTreeSetTest {
Copy link
Collaborator

Choose a reason for hiding this comment

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

тесты всё же надо дописать
-1

*/
public class MindTreeSet<E> implements MyTreeSet<E>{

Node start = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

мне кажется, их лучше сделать закрытыми

Node finish = null;
Node root = null;
int size = 0;
boolean ret = false;
Copy link
Collaborator

Choose a reason for hiding this comment

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

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

* Class with realising interface MyTreeSet
* @param <E> type of elements
*/
public class MindTreeSet<E> implements MyTreeSet<E>{
Copy link
Collaborator

Choose a reason for hiding this comment

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

тут бы не помешали какие-нибудь подходящие wilcard'ы генерикам

* @return result of compare
*/
private int compare(E e1, E e2) {
if (comparator == null) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

давайте в конструкторе проинициализируем компаратор, чтобы он использовал compareTo(). тогда не нужно будет постоянно эти проверки делать

Node<E> cur;
boolean direction;

TreeSetIterator(boolean r2) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

r2 тоже не особо удачное имя для аргумента

* @return true, if it's new element, false, if element is already exist
*/
@Override
public boolean add(E e) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

это слишком длинный и сложный метод, давайте разобьём его на несколько


Node start = null;
Node finish = null;
Node root = null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

давайте разделим сущности множества и дерева, которое оно использует для своей работы

**/
@Override
public MyTreeSet<E> descendingSet() { //
return null;
Copy link
Collaborator

Choose a reason for hiding this comment

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

это как-то не доделано
-0.5

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