

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Ngân hàng cũng sở hữu một bộ máy tổ chức vô cùng chặt chẽ và linh hoạt. Các chính sách đãi ngộ đã ngộ nhân viên vô cùng tốt nhằm mục đích chiêu mộ người tài vào làm việc cho ngân hàng.
Typology: Exercises
1 / 2
This page cannot be seen from the preview
Don't miss anything!


Bài tập:
def popS(self): if self.size <= 0 : return ("No element in the Stack") else: self.top-= self.size-= return self.stack.pop() def isEmpty(self): def getTop(self): AStack = Stack() AStack.pushS("Mon") AStack.pushS("Tue") AStack.pushS("Wed") AStack.pushS("Thu") print(AStack.popS()) print(AStack.popS())
When the above code is executed, it produces the following result − Thu Wed
class Queue: def init(self): self.queue = list() def addtoQ(self,dataval):
if dataval not in self.queue: self.queue.insert( 0 ,dataval) return True return False
def removefromQ(self): if len(self.queue)> 0 : return self.queue.pop() return ("No elements in Queue!") TheQueue = Queue() TheQueue.addtoq("Mon") TheQueue.addtoq("Tue") TheQueue.addtoq("Wed") print(TheQueue.removefromq()) print(TheQueue.removefromq())
When the above code is executed, it produces the following result − Mon Tue