Update doubly linked list#3619
Update doubly linked list#3619realDuYuanChao merged 4 commits intoTheAlgorithms:masterfrom realDuYuanChao:doublylinkedlist
Conversation
There was a problem hiding this comment.
There are really not enough tests here. This submission deletes a lot of tests which is going in the wrong direction. We need more tests, not fewer. It is OK to create a separate test file as long as pytest finds it via test discovery but it is too difficult to spot bugs without tests.
Please move the definition of Node before LinkedList.
The name of the file and the name of the main class should match so perhaps the class should be DoublyLinkedList.
add more test
|
Please add a doctest on |
|
@cclauss Done. |
|
OPTIONAL: Create % python3 >>> from __future__ import annotations
>>> from dataclasses import dataclass
>>> from typing import Any, Optional
>>> @dataclass
... class Node:
... data: Any
... prev: Optional[Node] = None
... next: Optional[Node] = None
...
>>> Node("Data")
Node(data='Data', prev=None, next=None) |
I'am not familiar with this. I think current version is friendly to beginner. BTW. this PR can be merged ? :) |
|
More worried about merging than learning? |
I will study in a few days. 👍 :) |
* update doubly linked list
* reformat code
add more test
* add test to iter
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* update doubly linked list
* reformat code
add more test
* add test to iter
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* update doubly linked list
* reformat code
add more test
* add test to iter
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
* update doubly linked list
* reformat code
add more test
* add test to iter
* updating DIRECTORY.md
Co-authored-by: github-actions <${GITHUB_ACTOR}@users.noreply.github.com>
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}.