Exemple #1
0
from listas import LinkedList

l = LinkedList()
print(f"L esta vacia? {l.is_empty()}")
l.append(10)
l.append(5)
l.append(6)
l.append(20)
print(f"L esta vacia? {l.is_empty()}")
l.transversal()
l.remove(10)
l.transversal()
l.prepend(3)
l.transversal()
print("-----")
x = l.tail()
print(x.data)
print("-----")
print(l.get())
Exemple #2
0
from listas import LinkedList

test = LinkedList()
test.append(10)
test.append(20)
test.append(30)
test.append(40)
test.transversal()
test.remove(30)
test.transversal()
test.prepend(50)
test.transversal()
test.add_before(20, 15)
test.transversal()
test.add_after(15, 16)
test.transversal()
test.remove(50)
test.transversal()
print(test.get().data)