Skip to main content

Questions tagged [stack]

A stack is a last in, first out (LIFO) abstract data type and data structure. Perhaps the most common use of stacks is to store subroutine arguments and return addresses.

44 votes
2 answers
40k views

Given an expression string exp, write a program to examine whether the pairs and the orders of "{","}","(",")","[","]" are correct in exp. For example,...
konijn's user avatar
  • 34.4k
31 votes
7 answers
67k views

Given an expression string exp, write a program to examine whether the pairs and the orders of "{","}","(",")","[","]" are correct in exp. For example,...
JavaDeveloper's user avatar
27 votes
1 answer
2k views

I wrote a stack implementation using a singly linked list in x86_64 assembly. This stack supports the usual push/pop operations ...
Bob65536's user avatar
  • 882
27 votes
1 answer
1k views

I made a stack monad that lets one manipulate and control values on a stack. I want to know if it's correct (it seems correct), how to make it faster, and how I could detect stack overflows without ...
user avatar
25 votes
3 answers
9k views

Leetcode: Valid parentheses Given a string containing just the characters (, ), {, ...
Gilad's user avatar
  • 5,443
17 votes
7 answers
4k views

I have implemented a stack in Python 3, and it works well. If anything needs to be improved, I would appreciate the criticism. ...
Brijesh Kalkani's user avatar
16 votes
6 answers
35k views

This code is based off the Stack implementation in Chapter 3 of Cracking The Coding Interview. I modified the code to make it compile and give me the correct output. I'd appreciate any feedback on ...
mathonsunday's user avatar
16 votes
4 answers
28k views

Please review my code and let me know how I can possibly improve it. ...
shubham's user avatar
  • 361
15 votes
3 answers
2k views

I'm developing a small programming language for use in any project I have where I feel a small scripting language could be used well. I've written two emulators for the language, one in C++ and one in ...
J_mie6's user avatar
  • 479
15 votes
2 answers
117k views

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 ...
Software Engineer's user avatar
14 votes
3 answers
2k views

Appreciate your thoughts and feedback... Stack.h ...
SRG's user avatar
  • 403
13 votes
5 answers
3k views

I have a exercise where I have to write a Stack class with the push and pop methods. The code compiles and works as it should. Are there better practices to use in my code? Is there something I should ...
John's user avatar
  • 241
13 votes
1 answer
2k views

I would like to request some code review and feedback on a stack implementation using Swift. Disclaimer: I might have not used protocols, optional unwrapping and error and ...
coderb's user avatar
  • 165
12 votes
3 answers
3k views

I have implemented a basic stack just for fun. I've just started learning about move constructors and assignment and move semantics as a whole, so I would really appreciate some feedback as to whether ...
Ivaylo Valchev's user avatar
12 votes
2 answers
7k views

VBA has a call stack... but there's no programmatic way to tap into it, which means in order to get a stack trace for a runtime error, one has to manage it manually. Here's some example code that ...
Mathieu Guindon's user avatar

15 30 50 per page
1
2 3 4 5
28