![]() Push will, obviously, push an item onto a stack. Some common operations on a stack are push, pop and peek. If you’re getting hundreds of mails a day, this might mean you’ll never see some of the mails that are on the bottom of your stack. The most recent mail will be shown at the top, and if you read your mails from top to bottom, you’ll read your most recent mails first. I good analogy would be your email inbox. Which basically means, the last element that you add to the stack is the first one that you’ll pull out. Stack is a LIFO data structure ( Last In First Out). We’ll implement it using another data structure called a ‘Linked List’, and for the sake of comparison, we will implement the same stack data structure using plain old arrays, and compare performances between the two. In this post we will examine one such structure called a ‘Stack’. ![]() Display\n4.In computer science there are many data structures. Printf("\n:: Stack using Linked List ::\n") Step 5 - Finally! Display ' temp → data -> NULL'.Repeat the same until temp reaches to the first node in the stack. ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |