Tagged Questions
5
votes
4answers
77 views
Stack implementation using only one queue in C
We start with an empty queue. For the push operation we simply insert the value to be pushed into the queue.
The pop operation needs some manipulation. When we need to pop from the stack (simulated ...
7
votes
3answers
799 views
Stack implementation using an array
I am trying a stack implementation using an array. I want to know if this approach is OK or if there is a logical problem. This program is working fine.
...
7
votes
2answers
293 views
3
votes
2answers
110 views
Dynamic stack in C - new version
Not long ago, I posted this dynamic stack for review. Now I wrote a new version, which is hopefully a better one.
Please take a look and let me know how I could improve performance and increase code ...
5
votes
3answers
340 views
Dynamic stack implementation
I wrote this code for a dynamic stack and would like to know what would be better if done differently.
It can increase memory by a percentage and/or fixed value when needed. It can also be set to not ...
4
votes
4answers
1k views
Reviewing my implementation of a stack using linked list
I have been studying data structures, and I'm new to this. Here is my code for the push and pop operations.
I considered using a node=top, so that I can avoid O(n) operations for the push (i.e. ...
8
votes
2answers
386 views
How can this simple coroutine implementation be improved?
This is a quick and dirty implementation of coroutines that implements yield by saving and restoring the stack to and from the heap. Here's an earlier version, which does the most naive possible ...
2
votes
3answers
239 views
Review implementation of stack by using pointers in C
After I had my code for stack implementation by array reviewed I wrote stack implementation by using pointers. Here's my code. Any suggestions for improvement are welcome.
I'll be adding updated ...
2
votes
2answers
615 views
Review implementation of stack by using array in C
This question has become long after many updates. Click here to go down.
I have implemented stack using arrays in C. Please give me suggestions on how to improve it. The purpose of writing it is ...
2
votes
2answers
387 views
Using pointers for string manipulation
I'm taking a sentence and determining whether or not it is a palindrome. I'm doing this while learning about stacks.
Is there a way I can use pointers instead of ...
3
votes
2answers
119 views
Another stack implementation (in C)
I just started learning C and the online book contained the exercise 'implement a stack'. So I did, but thought I'd put it here, because I still don't feel comfortable with pointers.
So here it is:
...
0
votes
2answers
377 views
symmetric string checking [closed]
I wrote this routine in C to check the symmetry of a string using only a stack.
(This is absolutely for educational purpose in our Theory Of Computation Class)
Anyways, does this look right?
For some ...
6
votes
3answers
257 views
implementation of a stack in C
Below is my implementation of a stack in C. Is it correct? And/or is there anything that I should fix to make it better in any way?
stack.h
...