def generate_data(self, data: LinkedList, pos, filename) -> None: with open(filename, "r") as infile: for line in infile: for x in line.split(): data.insert(int(x), pos) pos += 1 infile.close()
def generate_data(self, data: LinkedList, pos, n) -> None: for c in Coprime_pairs_iter(3, n, 2): data.insert(c[0], pos) data.insert(c[1], pos + 1) pos += 2
from LinkedList.LinkedList import LinkedList LinkedList = LinkedList() LinkedList.insert(22) LinkedList.insert(12) LinkedList.insert(134) LinkedList.insert(245) LinkedList.traverseList() LinkedList.remove(22) LinkedList.traverseList()