Skip to content

add Problem "linkedAfter"#61

Closed
MMachmerth wants to merge 15 commits into
git2025from
LinkedLists
Closed

add Problem "linkedAfter"#61
MMachmerth wants to merge 15 commits into
git2025from
LinkedLists

Conversation

@MMachmerth
Copy link
Copy Markdown
Contributor

No description provided.

@hsd-problem-testing
Copy link
Copy Markdown

hsd-problem-testing Bot commented Dec 19, 2025

Problem Solution Type Status Message
binary invalid_1 invalid
binary invalid_2 invalid
binary valid_1 valid
binary valid_2 valid
bogo invalid_1 invalid
bogo invalid_2 invalid
bogo invalid_3 invalid
bogo valid_1 valid
bubble invalid_1 invalid
bubble invalid_2 invalid
bubble invalid_3 invalid
bubble valid_1 valid
divide-integers alt_1 valid
divide-integers alt_2 valid
divide-integers invalid_1 invalid
divide-integers invalid_2 invalid
divide-integers invalid_3 invalid
einsen valid_1 valid
einstein alt_1 valid
emojize alt_1 valid
emojize alt_2 valid
emojize invalid_1 invalid
extensions alt_1 valid
extensions alt_2 valid
faces alt_1 valid
hackers valid_1 valid
hello alt_1 valid
iban valid_1 valid
insert invalid_1 invalid
insert valid_1 valid
interpreter valid_1 valid
intervals invalid_1 invalid
intervals valid_1 valid
linear valid_1 valid
linear valid_2 valid
luhn valid_1 valid
merge invalid_1 invalid
merge invalid_2 invalid
merge invalid_3 invalid
merge invalid_4 invalid
merge valid_1 valid
merge valid_2 valid
merge valid_3 valid
merge valid_4 valid
nadel alt_1 valid
neuner ⚠️
ReasonNo tests found
palindrom invalid_1 invalid
palindrom valid_1 valid
playback alt_1 valid
rotate invalid_1 invalid
rotate valid_1 valid
rotate valid_2 valid
rotate valid_3 valid
rotate valid_4 valid
run_back invalid_1 invalid
run_back invalid_2 invalid
run_back invalid_3 invalid
run_back valid_1 valid
strings alt_1 valid
stufen valid_1 valid
stufen valid_2 valid
sudoku1 valid_1 valid
sudoku1 valid_2 valid
sudoku1 valid_3 valid
sudoku2 valid_1 valid
tip alt_1 valid
willkommen alt_1 valid
zahlenjagd alt_1 valid
zeilen invalid_1 invalid
zeilen invalid_2 invalid
zeilen valid_1 valid
zeilen valid_2 valid

Problem Summary: 72 total

✅ Passed: 71
🔴 Failed: 0
⚠️ Warnings: 1

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a new programming problem called "linkedAfter" that teaches students about linked list operations in Python. The problem requires students to implement an insertAfterNode method that inserts a new node after a specified node in a linked list.

Key changes include:

  • HTML documentation and instructions in German for students
  • Automated test suite using check50 to validate student solutions
  • Configuration files for submission and testing workflows

Reviewed changes

Copilot reviewed 5 out of 6 changed files in this pull request and generated 14 comments.

Show a summary per file
File Description
linkedAfter/html/template.html Template for problem instructions with code examples and testing guidance
linkedAfter/html/linkedAfter.html Rendered HTML version of the problem instructions
linkedAfter/html/params.json Configuration parameters for the problem (IDs, paths, filenames)
linkedAfter/checks/main.py Automated test suite that validates the insertAfterNode implementation
linkedAfter/.cs50.yml Configuration file for check50 and submit50 tools

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linkedAfter/html/template.html Outdated
In dieser Übung werden Sie die Datenstruktur <strong>Verkettete Liste (Linked List)</strong> erweitern.
Gegeben sind bereits die Klassen <code>ListNode</code> und <code>LinkedList</code>, sowie einige
Hilfsmethoden zur Erzeugung einer verkettenten List aus eine Python Liste <code>FromPythonlist(inputList)</code>
und der Methode zur Ausgabe einer verkettetenListe <code>printList()</code>. Eine weitere Methode ist
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Spelling error: "verkettetenListe" should be "verketteten Liste". Missing space between "verketteten" and "Liste".

Suggested change
und der Methode zur Ausgabe einer verkettetenListe <code>printList()</code>. Eine weitere Methode ist
und der Methode zur Ausgabe einer verketteten Liste <code>printList()</code>. Eine weitere Methode ist

Copilot uses AI. Check for mistakes.
Comment thread linkedAfter/html/template.html Outdated
Gegeben sind bereits die Klassen <code>ListNode</code> und <code>LinkedList</code>, sowie einige
Hilfsmethoden zur Erzeugung einer verkettenten List aus eine Python Liste <code>FromPythonlist(inputList)</code>
und der Methode zur Ausgabe einer verkettetenListe <code>printList()</code>. Eine weitere Methode ist
<code>searchValue(value)</code> mit deren Hilfe Sie eine ListenElement mit einem bestimmten Wert
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Spelling error: "ListenElement" should be "Listenelement". In German compound nouns, the second part should be lowercase when forming a compound (unless it's a proper noun).

Suggested change
<code>searchValue(value)</code> mit deren Hilfe Sie eine ListenElement mit einem bestimmten Wert
<code>searchValue(value)</code> mit deren Hilfe Sie ein Listenelement mit einem bestimmten Wert

Copilot uses AI. Check for mistakes.
Comment thread linkedAfter/html/template.html Outdated
<p>
Implementieren Sie die Funktion <code>insertAfterNode</code> in Python.
Die Funktion bekommt das Element <code>prevNode</code> und das neue Element <code>newNode</code>
übergeben und soll das neuen Element in die Liste einfügen. Ist <code>prevNode</code> None,
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Grammar error: "das neuen Element" should be "das neue Element". The adjective "neuen" should be "neue" when used with the neuter article "das" in accusative case.

Suggested change
übergeben und soll das neuen Element in die Liste einfügen. Ist <code>prevNode</code> None,
übergeben und soll das neue Element in die Liste einfügen. Ist <code>prevNode</code> None,

Copilot uses AI. Check for mistakes.
Comment thread linkedAfter/html/linkedAfter.html Outdated
<p>
In dieser Übung werden Sie die Datenstruktur <strong>Verkettete Liste (Linked List)</strong> erweitern.
Gegeben sind bereits die Klassen <code>ListNode</code> und <code>LinkedList</code>, sowie einige
Hilfsmethoden zur Erzeugung einer verkettenten List aus eine Python Liste <code>FromPythonlist(inputList)</code>
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Spelling error: "verkettenten List" should be "verketteten Liste". The word "verkettenten" is misspelled (should be "verketteten") and "List" should be "Liste" (feminine noun in German requires the feminine article form).

Suggested change
Hilfsmethoden zur Erzeugung einer verkettenten List aus eine Python Liste <code>FromPythonlist(inputList)</code>
Hilfsmethoden zur Erzeugung einer verketteten Liste aus einer Python Liste <code>FromPythonlist(inputList)</code>

Copilot uses AI. Check for mistakes.
Comment thread linkedAfter/html/linkedAfter.html Outdated
In dieser Übung werden Sie die Datenstruktur <strong>Verkettete Liste (Linked List)</strong> erweitern.
Gegeben sind bereits die Klassen <code>ListNode</code> und <code>LinkedList</code>, sowie einige
Hilfsmethoden zur Erzeugung einer verkettenten List aus eine Python Liste <code>FromPythonlist(inputList)</code>
und der Methode zur Ausgabe einer verkettetenListe <code>printList()</code>. Eine weitere Methode ist
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Spelling error: "verkettetenListe" should be "verketteten Liste". Missing space between "verketteten" and "Liste".

Suggested change
und der Methode zur Ausgabe einer verkettetenListe <code>printList()</code>. Eine weitere Methode ist
und der Methode zur Ausgabe einer verketteten Liste <code>printList()</code>. Eine weitere Methode ist

Copilot uses AI. Check for mistakes.

print("Liste nachher:")
ll.printList()
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The expected output comment is incorrect. Given the list construction method using insertAfterHead (which reverses the order), the list starts as [4, 8, 2, 1]. After inserting 3 after 8, it should be [4, 8, 3, 2, 1], not [1, 2, 8, 3, 4]. This comment could mislead students about the expected behavior.

Suggested change
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
# Erwartete Ausgabe: 4 -> 8 -> 3 -> 2 -> 1 -> None

Copilot uses AI. Check for mistakes.
Comment thread linkedAfter/html/linkedAfter.html Outdated
Gegeben sind bereits die Klassen <code>ListNode</code> und <code>LinkedList</code>, sowie einige
Hilfsmethoden zur Erzeugung einer verkettenten List aus eine Python Liste <code>FromPythonlist(inputList)</code>
und der Methode zur Ausgabe einer verkettetenListe <code>printList()</code>. Eine weitere Methode ist
<code>searchValue(value)</code> mit deren Hilfe Sie eine ListenElement mit einem bestimmten Wert
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Spelling error: "ListenElement" should be "Listenelement". In German compound nouns, the second part should be lowercase when forming a compound (unless it's a proper noun).

Suggested change
<code>searchValue(value)</code> mit deren Hilfe Sie eine ListenElement mit einem bestimmten Wert
<code>searchValue(value)</code> mit deren Hilfe Sie eine Listenelement mit einem bestimmten Wert

Copilot uses AI. Check for mistakes.
Comment thread linkedAfter/html/linkedAfter.html Outdated
<p>
Implementieren Sie die Funktion <code>insertAfterNode</code> in Python.
Die Funktion bekommt das Element <code>prevNode</code> und das neue Element <code>newNode</code>
übergeben und soll das neuen Element in die Liste einfügen. Ist <code>prevNode</code> None,
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Grammar error: "das neuen Element" should be "das neue Element". The adjective "neuen" should be "neue" when used with the neuter article "das" in accusative case.

Suggested change
übergeben und soll das neuen Element in die Liste einfügen. Ist <code>prevNode</code> None,
übergeben und soll das neue Element in die Liste einfügen. Ist <code>prevNode</code> None,

Copilot uses AI. Check for mistakes.

print("Liste nachher:")
ll.printList()
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The expected output comment is incorrect. Given the list construction method using insertAfterHead (which reverses the order), the list starts as [4, 8, 2, 1]. After inserting 3 after 8, it should be [4, 8, 3, 2, 1], not [1, 2, 8, 3, 4]. This comment could mislead students about the expected behavior.

Suggested change
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
# Erwartete Ausgabe: 4 -> 8 -> 3 -> 2 -> 1 -> None

Copilot uses AI. Check for mistakes.
Comment thread linkedAfter/checks/main.py Outdated
raise check50.Failure(msg)

if not hasattr(module.LinkedList(), "insertAfterNode"):
msg = "Method `insertAfterNode` not found Class `LinkedList`"
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Grammar error in error message: "not found Class" should be "not found in Class". Missing the preposition "in" between "found" and "Class".

Suggested change
msg = "Method `insertAfterNode` not found Class `LinkedList`"
msg = "Method `insertAfterNode` not found in Class `LinkedList`"

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linkedAfter/checks/main.py Outdated
threw = True

if not threw:
msg = "insertAfterNode should raise an error when prevNode is None (not found)"
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The error message is unclear and uses an unexpected format. The message says "insertAfterNode should raise an error when prevNode is None (not found)" but should be more specific about what type of error is expected. The task description specifies that a ValueError should be raised, so the message should explicitly mention ValueError to help students understand the requirement.

Suggested change
msg = "insertAfterNode should raise an error when prevNode is None (not found)"
msg = "insertAfterNode should raise ValueError when prevNode is None (not found)"

Copilot uses AI. Check for mistakes.

print("Liste nachher:")
ll.printList()
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The expected output in the documentation is incorrect. The comment states "Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None", but based on the FromPythonlist implementation which uses insertAfterHead, the list is actually built in reverse order. For inputList = [1, 2, 8, 4], the resulting list will be 4 -> 8 -> 2 -> 1, so after inserting 3 after 8, the expected output should be "4 -> 8 -> 3 -> 2 -> 1 -> None", not "1 -> 2 -> 8 -> 3 -> 4 -> None".

Suggested change
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
# Erwartete Ausgabe: 4 -> 8 -> 3 -> 2 -> 1 -> None

Copilot uses AI. Check for mistakes.

print("Liste nachher:")
ll.printList()
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

The expected output in the documentation is incorrect. The comment states "Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None", but based on the FromPythonlist implementation which uses insertAfterHead, the list is actually built in reverse order. For inputList = [1, 2, 8, 4], the resulting list will be 4 -> 8 -> 2 -> 1, so after inserting 3 after 8, the expected output should be "4 -> 8 -> 3 -> 2 -> 1 -> None", not "1 -> 2 -> 8 -> 3 -> 4 -> None".

Suggested change
# Erwartete Ausgabe: 1 -> 2 -> 8 -> 3 -> 4 -> None
# Erwartete Ausgabe: 4 -> 8 -> 3 -> 2 -> 1 -> None

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 6 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

threw = True

if not threw:
msg = "insertAfterNode should raise an ValueError when prevNode is None"
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Error message typo: "insertAfterNode should raise an ValueError" should be "insertAfterNode should raise a ValueError". The article before "ValueError" should be "a" not "an" since ValueError starts with a consonant sound.

Suggested change
msg = "insertAfterNode should raise an ValueError when prevNode is None"
msg = "insertAfterNode should raise a ValueError when prevNode is None"

Copilot uses AI. Check for mistakes.
@check50.check(has_classes_and_method)
def test_insert_after_none_prevnode():
"""insertAfterNode with prevNode=None:
We expect an exception (ValueError) rather than silently doing nothing."""
Copy link

Copilot AI Dec 19, 2025

Choose a reason for hiding this comment

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

Documentation inconsistency: The multi-line string states "We expect an exception (ValueError)" but doesn't specify which exception type using proper formatting. Consider using backticks around ValueError for consistency with code documentation standards.

Suggested change
We expect an exception (ValueError) rather than silently doing nothing."""
We expect an exception (`ValueError`) rather than silently doing nothing."""

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 32 out of 40 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linkedMerge/html/params.json Outdated
Comment thread linkedMerge/html/linkedMerge.html Outdated
MMachmerth and others added 4 commits December 22, 2025 12:17
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 32 out of 40 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread linkedAfter/html/template.html Outdated
newNode = ListNode(value=val)
self.insertAfterHead(newNode)

def searchValue(self, value: int) -> ListNode:
Copy link

Copilot AI Dec 22, 2025

Choose a reason for hiding this comment

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

The return type annotation for searchValue is incorrect. The method signature shows it returns ListNode but should return ListNode | None to match the actual implementation in other files and handle cases where the value is not found.

Suggested change
def searchValue(self, value: int) -> ListNode:
def searchValue(self, value: int) -> ListNode | None:

Copilot uses AI. Check for mistakes.
@MMachmerth MMachmerth closed this Dec 22, 2025
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