Conversation
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Linked lists
Problem Summary: 81 total✅ Passed: 79 |
There was a problem hiding this comment.
Pull request overview
This pull request adds new linked list programming exercises and improves an existing binary search exercise for what appears to be a data structures and algorithms course. The changes include HTML templates for exercise instructions (in German), automated test suites, and configuration files.
Key changes:
- Updated the
run_backexercise to use a 4-parameter binary search function with explicit low/high indices - Added 6 new linked list exercises covering fundamental operations (search, insert, remove, merge, stack implementation)
- Included comprehensive test coverage and HTML documentation for each exercise
Reviewed changes
Copilot reviewed 34 out of 43 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| run_back/html/template.html | Updated binary search exercise to use explicit low/high parameters with validation code |
| run_back/checks/main.py | Updated all test cases to pass low/high indices (0, len-1) to binary_recursive function |
| linkedStack/* | New exercise implementing a stack using a linked list with push/pop/peek operations |
| linkedRemove/* | New exercise for removing elements from a linked list |
| linkedMerge/* | New exercise for merging two sorted linked lists |
| linkedInsert/* | New exercise for inserting elements at the end of a linked list |
| linkedFind/* | New exercise for searching values in a linked list |
| linkedAfter/* | New exercise for inserting elements after a specific node |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
run_back/html/template.html
Outdated
| {% include "file.html" %} | ||
| Implementieren Sie die folgende Funktion in Ihrer Datei: | ||
| Implementieren Sie die folgende Funktion in Ihrer Datei. Die Überpüfung der Array Grenzen | ||
| ist bereits erfolgt, vervollständigen Sie den Code für der rekursive Suche: |
There was a problem hiding this comment.
The German text contains a typo: "Überpüfung" should be "Überprüfung". Additionally, "für der rekursive Suche" contains a grammatical error - it should be "für die rekursive Suche" (feminine article for "Suche").
run_back/html/template.html
Outdated
| print(binary_recursive(list, 8, low=0, high=len(list))) # Erwartet: 2 | ||
| list = [11, 13, 15, 17, 18] | ||
| print(binary_recursive(list, 17, low=0, high=len(list))) # Erwartet: 3 | ||
| list = [3, 4, 5, 6, 7] | ||
| print(binary_recursive(list, 1, low=0, high=len(list))) # Erwartet: -1 | ||
| list = [] | ||
| print(binary_recursive(list, 13, low=0, high=len(list))) # Erwartet: -1 |
There was a problem hiding this comment.
The test examples in the HTML template use high=len(list) but the actual tests in main.py use len(list) - 1. This inconsistency will cause confusion for students. The HTML template should match the test implementation and use len(list) - 1 for the high parameter.
| def a(self, b): | ||
| c = self.head | ||
| while c is not None: | ||
| if c.value == b: | ||
| return c | ||
| c = c.next | ||
| return None |
There was a problem hiding this comment.
The function name a with parameter b and variable c is not descriptive. This appears to be a helper function for searching values in a linked list. Consider using meaningful names like search_value_impl for the function, value for the parameter, and current for the variable to improve code readability.
| # Perform a search that requires recursion | ||
| result = module.binary_recursive([1, 2, 3, 4, 5, 6, 7], 6) | ||
| list = [1, 2, 3, 4, 5, 6, 7] | ||
| result = module.binary_recursive(list, 6, 0, len(list) - 1) |
There was a problem hiding this comment.
Variable result is not used.
e025493 to
6bb2cc2
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 34 out of 43 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| list = [6, 7, 8, 9, 10] | ||
| result = module.binary_recursive(list, 8, 0, len(list) - 1) |
There was a problem hiding this comment.
The variable name "list" shadows the built-in Python type. This is a Python anti-pattern that should be avoided. Consider using a more descriptive name like "test_list" or "values" instead.
run_back/html/template.html
Outdated
| print(binary_recursive([11, 13, 15, 17, 18], 17)) # Erwartet: 3 | ||
| print(binary_recursive([3, 4, 5, 6, 7], 1)) # Erwartet: -1 | ||
| print(binary_recursive([], 13)) # Erwartet: -1 | ||
| list = [6, 7, 8, 9, 10] |
There was a problem hiding this comment.
The variable name "list" shadows the built-in Python type. This is a Python anti-pattern that should be avoided. Consider using a more descriptive name like "test_list" or "values" instead.
run_back/html/template.html
Outdated
| list = [11, 13, 15, 17, 18] | ||
| high_idx = len(list) - 1 | ||
| print(binary_recursive(list, 17, low = 0, high = high_idx)) # Erwartet: 3 | ||
|
|
||
| list = [3, 4, 5, 6, 7] | ||
| high_idx = len(list) - 1 | ||
| print(binary_recursive(list, 1, low = 0, high = high_idx)) # Erwartet: -1 | ||
|
|
||
| list = [] | ||
| high_idx = len(list) - 1 | ||
| print(binary_recursive(list, 13, low = 0, high = high_idx)) # Erwartet: -1 |
There was a problem hiding this comment.
The variable name "list" shadows the built-in Python type. This is repeated across all test examples in this section. Consider using "test_list" or "values" instead throughout.
…r low and high index
6bb2cc2 to
f2cceea
Compare
No description provided.