954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

linked list implementation of stacks

Hello all,

I am wondering if anyone has any or know where I can get examples of
source code using linked list implementation of stacks. It needs to use a class that stores ints that can be retrieved.

Anything you all can provide would be great!!!:-|

KimJack
Junior Poster
114 posts since Apr 2006
Reputation Points: 8
Solved Threads: 0
 

Here's an idea: Why not try writing it yourself first, instead of leeching off of other people because you can't be bothered to think?

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

Well, you're going to need to gut out your own linked list code (that's the hardest part of this assignment, really). Then you'll need some mechanism to gaurantee that the last item entered into the list is the first item removed from the list. NOTE--that doesn't necessarily mean that the last item entered into the list has to be the last item of the list. After that, it's pretty straightforward to provide the other methods routinely associated with a stack.

Lerner
Nearly a Posting Maven
2,382 posts since Jul 2005
Reputation Points: 739
Solved Threads: 396
 

Some where in your life, I hope you recieve some kindness. You are obviously lacking in receiving since you lack the knowledge of giving.

KimJack
Junior Poster
114 posts since Apr 2006
Reputation Points: 8
Solved Threads: 0
 

There was a thread on another forum a few days ago about Linked Lists, give it a read, because the answers might help you. http://cboard.cprogramming.com/showthread.php?t=78460

Bench
Posting Pro
577 posts since Feb 2006
Reputation Points: 307
Solved Threads: 63
 

>You are obviously lacking in receiving since you lack the knowledge of giving.
If I give you code without any effort on your part, I've done nothing but hurt you. I wouldn't expect you to have the foresight to appreciate the difference yet, but if you stick to programming, you'll eventually understand. And at that point I hope you regret being a jerk to all of the people who were trying to help you.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 
>You are obviously lacking in receiving since you lack the knowledge of giving. If I give you code without any effort on your part, I've done nothing but hurt you. I wouldn't expect you to have the foresight to appreciate the difference yet, but if you stick to programming, you'll eventually understand. And at that point I hope you regret being a jerk to all of the people who were trying to help you.


Mr/Ms Narue this was directed to you and only you. I understand and appreciate exactly what you are saying. However, somewhere in your life the word tact needs to be defined. It is not what you said but how you came across, simply rude. If you don't have any positive advice, please refrain from negative comments. Thank you. Again, I do understand what you are saying and hope you realize that displacement, on your part, is not pretty.

KimJack
Junior Poster
114 posts since Apr 2006
Reputation Points: 8
Solved Threads: 0
 
There was a thread on another forum a few days ago about Linked Lists, give it a read, because the answers might help you. http://cboard.cprogramming.com/showthread.php?t=78460

Thank you Bench the site was a big help:idea: .

KimJack
Junior Poster
114 posts since Apr 2006
Reputation Points: 8
Solved Threads: 0
 

>It is not what you said but how you came across, simply rude.
I'm not surprised that you have no idea what I'm doing. Here's a hint: You're not likely to forget what I've told you. Emotional trauma creates longlasting memories.

>Again, I do understand what you are saying
No, you don't. But you will...if you find any measure of success in programming.

>hope you realize that displacement, on your part, is not pretty.
That's a very nice attempt. Unsuccessful, but very nice indeed.

Narue
Bad Cop
Administrator
15,460 posts since Sep 2004
Reputation Points: 6,464
Solved Threads: 1,401
 

>It is not what you said but how you came across, simply rude. I'm not surprised that you have no idea what I'm doing. Here's a hint: You're not likely to forget what I've told you. Emotional trauma creates longlasting memories.

>Again, I do understand what you are saying No, you don't. But you will...if you find any measure of success in programming.

>hope you realize that displacement, on your part, is not pretty. That's a very nice attempt. Unsuccessful, but very nice indeed.

"If you ever think Narue is wrong, remember one thing: She's not. ":lol:

KimJack
Junior Poster
114 posts since Apr 2006
Reputation Points: 8
Solved Threads: 0
 

Generally, I agree with Narue about the giving away the code part. Most of my teachers and professors were the same way.

But to stay on topic, there are many ways of using linked lists to implement the stack. Back in my sophmore year of college, I did it using doubly linked lists (they were the easiest). However, there are many ways. Once again, I dont want to give the code to you until you try some yourself.

Good luck ;)

MIGSoft
Posting Pro in Training
473 posts since Jul 2005
Reputation Points: 10
Solved Threads: 2
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You