All Questions
14 questions
2
votes
2
answers
136
views
LinkedList Stack Implementation
I'm new to the programming and I want to ask a question about my linkedlist stack implementation if it's correct and if it meets the requirements of the linkedlist stack implementation. If there is ...
0
votes
2
answers
76
views
Another Stack implementation in Java
I'm trying to write my own stack implementation using LinkedList. It looks like it is doing what it should doing. But how does it look from a design perspective?
...
9
votes
2
answers
2k
views
A counterexample in balanced parentheses
In this program I had to analyse if the parenthesis given are well balanced. For instance, input (()) is correct and input ())(()...
1
vote
1
answer
632
views
Analyzing an arithmetic expression using stacks
I'm looking for some constructive (harsh) criticism of a homework I've done (the code works fine). Also Is there a better/another way to solve the exercise?
Exercise:
Read an arithmetic expression ...
4
votes
2
answers
293
views
My implementation of Stack and Queue with Array without help of library functions
I am new to Java and am trying to learn coding. Here is my implementation of a stack and a queue without the help of library functions. Please provide your suggestions on design, coding style and ...
0
votes
1
answer
580
views
Sort a stack using Java
This is my attempted solution to cracking the coding interview exercise 3.5. Looking for any feedback on coding style or the algorithm anywhere I can improve really.
The problem specification is as ...
2
votes
2
answers
83
views
Program looks for correct balance of ( [ and { in expression
I'm still new to programming. (First exposure was school about a year ago), and for some reason this problem really gave me a lot of problems trying to solve it. Can you help me understand what I ...
10
votes
2
answers
2k
views
Implementation of stack
Task:
Create a class RPNStack which represents a stack of objects of type
Node. Class RPNStack contains only one private field top of type Node.
Objects of type Node represent data that are ...
5
votes
2
answers
3k
views
Simple FIFO and LIFO ferry simulator
I am trying to make a ferry simulator with one ferry that works like a stack and another like a queue. I have a working class for stacks and queues with pop/push; I am trying to figure out how to ...
6
votes
1
answer
8k
views
Palindrome using stack
I recently started learning Java, algorithms, and data structures. I am trying to check if a string is palindrome. I would like a review to see where and how I could improve.
...
2
votes
3
answers
3k
views
Delimiter-matching using Stack in Java
Is this code okay?
...
10
votes
6
answers
24k
views
Reversing a String using Stack
Is this code okay?
...
8
votes
4
answers
65k
views
Array Implementation of Stack
I've implemented the basic logic of a stack data structure. How can I make this code more generic? Is there any better way to display the stack contents?
StackMethods.java
...
10
votes
3
answers
113k
views
Stack implementation using a linked list
To understand the concept, I implemented the stack operations using a linked list. Please review the code and tell me your suggestions.
Node.java
...