node.py:
class Node:
def __init__(self, initdata):
self.data = initdata
self.next = None
def getData(self):
return self.data
def getNext(self):
return self.next
def setData(self, newData):
self.data = newData
def setNext(self, newnext):
self.next = newnext
————————————————————————————————–
llstack.py:
from node import Node
class LLStack:
def __init__(self):
self.head = None
def isEmpty(self):
return self.head == None
def push(self, item):
temp = Node(item)
temp.setNext(self.head)
self.head = temp
def pop(self):
item = self.head.getData()
self.head = self.head.getNext()
return item
def length(self):
current = self.head
count = 0
while current != None:
count += 1
current = current.getNext()
return count
def printList(self):
current = self.head
while current != None:
print(current.getData(), end = ” “)
current = current.getNext()
print()
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.
The post can-you-do-my-assignment-with-extra-credit-for-python- appeared first on Custom Nursing Help.