data_structures.linked_list.middle_element_of_linked_list

Attributes

link

Classes

LinkedList

Node

Module Contents

class data_structures.linked_list.middle_element_of_linked_list.LinkedList
middle_element() int | None
>>> link = LinkedList()
>>> link.middle_element()
No element found.
>>> link.push(5)
5
>>> link.push(6)
6
>>> link.push(8)
8
>>> link.push(8)
8
>>> link.push(10)
10
>>> link.push(12)
12
>>> link.push(17)
17
>>> link.push(7)
7
>>> link.push(3)
3
>>> link.push(20)
20
>>> link.push(-20)
-20
>>> link.middle_element()
12
>>>
push(new_data: int) int
head = None
class data_structures.linked_list.middle_element_of_linked_list.Node(data: int)
data
next = None