class Queues: def __init__(self): self.ins = SinglyLinkedList() def enqueue(self, data): self.ins.adding(data) def dequeue(self): return self.ins.del_head() def display(self): return self.ins.display()
class Stacks: def __init__(self): self.ins = SinglyLinkedList() def push(self, data): self.ins.add_head(data) def pop(self): return self.ins.del_head() def display(self): return self.ins.display()
class UniversalMethod: def __init__(self): self.ins = SinglyLinkedList() def add_head(self, data): self.ins.add_head(data) def del_head(self): return self.ins.del_head() def add_end(self, data): self.ins.adding(data) def display(self): return self.ins.display()