Tagged Questions
6
votes
4answers
139 views
Stack with 'getMinimum' operation
Design a Data Structure SpecialStack that supports all the stack operations like push(), pop(), isEmpty(), isFull() and an additional operation getMin() which should return minimum element from the ...
4
votes
1answer
46 views
Stack with “getMiddle” and “deleteMiddle” operation
Looking for code review, optimizations and best practices.
...
4
votes
1answer
34 views
Implement stack using a linked list
I am trying to implement Stack using a linked list. Looking for code-review, best practices and optimizations.
...
3
votes
2answers
143 views
How is my Java code for stack implementation?
The following example shows how to implement stack by creating user defined push() method for entering elements and pop() method ...
0
votes
2answers
89 views
Stack implementation using a queue
I've implemented a stack using a queue.
Time complexity:
\$O(n)\$ - push(), where n is the number of elements in the queue
\$O(1)\$ - ...
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 ...
3
votes
2answers
10k views
Stack implementation using linked list
This is a working stack implementation using a linked list. I'm just curious to know if this is a good way of doing it. Any suggestions are welcome. Can we keep track of the number of elements in ...
2
votes
2answers
385 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 ...
8
votes
2answers
371 views
Which is the most correct pattern for using Stack.Pop?
There at least 2 patterns of using Stack.Pop
...
2
votes
4answers
5k views
Linked list stack implementation
I have used the following code for a stack implementation. The top keeps track of the topmost node of the stack. Now since top ...