Appends each item to the end of the LinkedList. >>> linked_list = LinkedList() >>> linked_list.extend([]) >>> str(linked_list) '' >>> linked_list.extend([1, 2]) >>> str(linked_list) '1 -> 2' >>> linked_list.extend([3,4]) >>> str
(self, items: Iterable[int])
| 69 | self.head = self.tail = Node(data) |
| 70 | |
| 71 | def extend(self, items: Iterable[int]) -> None: |
| 72 | """Appends each item to the end of the LinkedList. |
| 73 | >>> linked_list = LinkedList() |
| 74 | >>> linked_list.extend([]) |
| 75 | >>> str(linked_list) |
| 76 | '' |
| 77 | >>> linked_list.extend([1, 2]) |
| 78 | >>> str(linked_list) |
| 79 | '1 -> 2' |
| 80 | >>> linked_list.extend([3,4]) |
| 81 | >>> str(linked_list) |
| 82 | '1 -> 2 -> 3 -> 4' |
| 83 | """ |
| 84 | for item in items: |
| 85 | self.append(item) |
| 86 | |
| 87 | |
| 88 | def make_linked_list(elements_list: Iterable[int]) -> LinkedList: |
no test coverage detected