Program to implement stack operations (Push, Pop, Display) on a stack using linked lists. | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 4

Program to implement stack operations (Push, Pop, Display) on a stack using linked lists.

Help me finish this program to implement stack operations (Push, Pop, Display) on a stack using linked lists. So far the program only performs Push operation, Pop operation and notifies the user what element has been Popped. Help me create a function to display the elements in the stack. Code link is below; https://code.sololearn.com/cb5jPG5n4P6m/?ref=app Sample of how to input data can be found on the following url: https://ibb.co/PgJPsSd

12th Mar 2022, 1:27 PM
Takudzwa A Svosve
Takudzwa A Svosve - avatar
2 Réponses
+ 1
def display(self): while self.head: print(self.head.data) self.head = self.head.next
12th Mar 2022, 1:56 PM
Jayakrishna 🇮🇳
+ 4
Hey Jayakrishna🇮🇳 , sorry for the late response. Let me work on the code ASAP.
13th Mar 2022, 8:03 PM
Takudzwa A Svosve
Takudzwa A Svosve - avatar