'Returns a random node\'s value.
:rtype: int'

def getRandom(self):

    reservoir = self.__head.val
    (curr, n) = (self.__head.next, 1)
    while curr:
        reservoir = (curr.val if (randint(1, (n + 1)) == 1) else reservoir)
        (curr, n) = (curr.next, (n + 1))
    return reservoir
