Considering a singly linked list of integers implementation, assuming that elements of the list are always in
Fantastic news! We've Found the answer you've been seeking!
Question:
Considering a singly linked list of integers implementation, assuming that elements of the list are always in ascending order, write a function (find_median) that finds and returns median value. The function cannot scan the list more than ONCE. Note that there is no member variable _size that keeps track of the number of element in the linked list
class SinglyList:
class _Node:
def __init__(self, e, next):
self._element = e
self._next = next
def __init__(self):
self._head = self._tail = None
def find_median(self):
Related Book For
Posted Date: