Adding IndexedLinkedList and its tests.#321
Conversation
garydgregory
left a comment
There was a problem hiding this comment.
Hello,
What is the use case here compared to the existing CursorableLinkedList and NodeCachingLinkedList? Why would a user choose this 3rd implementation instead of one of the other two? I think we need a strong case to add yet another linked list and not confuse users.
| * element (which requires \(\mathcal{O}(\sqrt{n})\) on evenly distributed | ||
| * finger lis). | ||
| * | ||
| * @author Rodion "rodde" Efremov |
There was a problem hiding this comment.
FYI, we do not use author tags. Attribution is usually done in changes.xml, and/or pom.xml.
| * | ||
| * @author Rodion "rodde" Efremov | ||
| * @version 1.61 (Sep 26, 2021) | ||
| * @since 1.6 (Sep 1, 2021) |
There was a problem hiding this comment.
The next version of Collections is 4.5
| * @version 1.61 (Sep 26, 2021) | ||
| * @since 1.6 (Sep 1, 2021) | ||
| */ | ||
| public class IndexedLinkedList<E> implements Deque<E>, |
There was a problem hiding this comment.
This should fit in the rest of the framework by subclassing AbstractLinkedList
| import org.junit.Before; | ||
| import org.junit.Test; | ||
|
|
||
| public class FingerListTest { |
There was a problem hiding this comment.
Should extend AbstractLinkedListTest
There was a problem hiding this comment.
Disagree. FingerList is not a conventional collection type, but rather an ad hoc list of fingers. Each FingerList is part of internals of IndexedLinkedList and is not exposed outside the ...list package.
There was a problem hiding this comment.
Disagree.
FingerListis not a conventional collection type, but rather an ad hoc list of fingers. EachFingerListis part of internals ofIndexedLinkedListand is not exposed outside the...listpackage.
So why is it public?
| import org.junit.Before; | ||
| import org.junit.Test; | ||
|
|
||
| public class IndexedLinkedListTest { |
There was a problem hiding this comment.
Should extend AbstractLinkedListTest
|
-1: This code does not even compile. The packaging is obviously wrong. |
|
When I extend the |
Adding:
IndexedLinkedList.javaIndexedLinkedListTest.javaFingerListTest.java