uebung_03: implement Task 1 (IntLinkedList) and Task 2 (generic LinkedList)

Doubly linked list with head/tail references for int values (Task 1)
and a generic LinkedList<T>/ListNode<T> version (Task 2). Both
implement add, get, remove, getSize with O(n/2) walks via the
closer-end heuristic. Includes IntLinkedListTest covering empty,
single-element, head/tail/middle removal, and out-of-bounds cases.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-23 22:06:24 +02:00
parent 879d6a8721
commit e5fab1bec5
5 changed files with 398 additions and 0 deletions

View File

@@ -0,0 +1,11 @@
public class IntListNode {
int value;
IntListNode nextNode;
IntListNode prevNode;
public IntListNode(int value, IntListNode nextNode, IntListNode prevNode) {
this.value = value;
this.nextNode = nextNode;
this.prevNode = prevNode;
}
}