Skip to content

Commit 60d8fa3

Browse files
committed
Update kth_element_from_end docstring
1 parent 2bc9848 commit 60d8fa3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

data_structures/linked_list/kth_element_from_end.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,10 @@ def add(self, item: Any, position: int = 0) -> None:
5555

5656
def kth_element_from_end(self, k: int) -> Any:
5757
"""
58-
Find the kth node from the end of the Linked List
58+
Find the kth node element from the end of the Linked List.
59+
This is not a zero-based index search.
60+
If k=1, it will return the last element in the list.
61+
5962
>>> linked_list = LinkedList()
6063
>>> linked_list.add(1)
6164
>>> linked_list.add(2)

0 commit comments

Comments
 (0)