Skip to content

Исправлен класс с тестами#12

Merged
Lillisipp merged 2 commits intomainfrom
sprint_6-solution
May 9, 2025
Merged

Исправлен класс с тестами#12
Lillisipp merged 2 commits intomainfrom
sprint_6-solution

Conversation

@Lillisipp
Copy link
Owner

у меня была проблема с веткой мейна
она менялась вместе с этой, а по откатам я много чего натыкала и откатывая у меня и ветка с 6 спринтом откатилась
подгрузила библиотеки

@Lillisipp Lillisipp force-pushed the sprint_6-solution branch 4 times, most recently from 5f7b5ce to 8612e5a Compare May 6, 2025 19:28
@Lillisipp Lillisipp force-pushed the sprint_6-solution branch from 8612e5a to 7f3d740 Compare May 6, 2025 20:31
linkLast(task);
}
if (history.size() > 10) {
if (history.size() > 10

Choose a reason for hiding this comment

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

по тз: "Сделать историю посещений неограниченной по размеру."

Copy link

@Alexander-Bolotov Alexander-Bolotov May 7, 2025

Choose a reason for hiding this comment

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

так же
private Map<Integer, Node> history = new LinkedHashMap<>();
по тз нужно реализовать собственный связанный список:
"Поэтому вам предстоит написать собственную реализацию связного списка с индексом по id задачи.
... создайте стандартную HashMap. Её ключом будет id задачи, а значением — узел связного списка."

LinkedHashMap сам управляет связью узлов, что нарушает требование "самостоятельно реализовать связный список + хранение ссылок в Node".
Из-за этого linkLast и removeNode становятся полуработающими: данные лежат одновременно в LinkedHashMap и в Node.

нужно просто LinkedHashMap заменить на HashMap

Copy link
Owner Author

Choose a reason for hiding this comment

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

по тз: "Сделать историю посещений неограниченной по размеру."

она не ограничена, это условие для удаления, когда их больше 10 штук в самой истории просмотров

@Lillisipp Lillisipp merged commit 9938cb7 into main May 9, 2025
1 check passed
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