Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
4 votes
4 answers
1k views

Stack - implementation in Java

I implemented a stack data structure without using any libraries or Java API code. ...
Mardson Diego's user avatar
0 votes
1 answer
79 views

Delayed, concurrent event stack in Java - follow-up

I have slightly refactored the Delayed, concurrent event stack in Java. Now it looks like this: DelayedEventStack.java ...
coderodde's user avatar
  • 31.3k
0 votes
3 answers
212 views

Delayed, concurrent event stack in Java

(See the next iteration: Delayed, concurrent event stack in Java - follow-up ) Motivation I was confronted with a task of having "message events" for a GUI program. The use case is as ...
coderodde's user avatar
  • 31.3k
2 votes
0 answers
48 views

JavaScript Linter in Java

I wrote a simple Linter that checks for matching opening and closing braces for one line of JavaScript. It utilizes a stack to store opening braces found in the line, then compares the first closing ...
dbrokamp's user avatar
3 votes
1 answer
575 views

Finding the minimum element of a stack of numbers

As part of an online programming challenge, I wrote a program that implements a stack of integers, supporting adding and removing elements, finding the last inserted element, and the minimum element. ...
gparyani's user avatar
  • 131
1 vote
1 answer
1k views

Concurrent Queue with enqueue and dequeue using Stack as underlying data structure

This is a mix of data structure and multi threading concept based question. (This is only for understanding and learning purpose) The language for the solution : Java A Queue with FIFO behavior needs ...
Krishna Kumar's user avatar
2 votes
2 answers
80 views

Queue By Using Stack

I have implemented a queue by using a stack data structure. How could I improve it? ...
Neslihan Bozer's user avatar
4 votes
1 answer
975 views

Codility Fish (queue) programming challenge

Today I have attempted a Codility exercise "Fish" (https://app.codility.com/programmers/lessons/7-stacks_and_queues/fish/), and I have to say I found it to be: 1) Not necessarily "easy" as implied by ...
Greem666's user avatar
  • 143
13 votes
5 answers
3k views

Stack class in Java 8

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
5 votes
2 answers
2k views

Thread-safe stack in Java with fixed capacity

Implement a multi-threaded stack, with freedom to use existing implementations of stack. On top of being thread-safe, it must block (not busy-wait) a pushing thread when stack is full and a ...
user5447339's user avatar
3 votes
2 answers
583 views

Leetcode - find if BST is valid or not

Given a binary tree, determine if it is a valid binary search tree (BST). Assume a BST is defined as follows: The left subtree of a node contains only nodes with keys less than the node's key. The ...
Mosbius8's user avatar
  • 787
8 votes
3 answers
2k views

Stack as a Persistent Data Structure Implementation

After reading some articles about immutability, I found out that there are persistent data structures. In the following, I implemented a stack as a persistent data structure. What I like about the ...
Roman's user avatar
  • 2,903
3 votes
2 answers
916 views

Using the stack algorithm for parenthesis matching

I have used Stacks to check for brackets mismatch. (Parentheses matching problem using Stack algorithm) Any suggestions on how to improve the code? I have tried various examples and it works ...
Archer's user avatar
  • 315
1 vote
2 answers
75 views

Stack Array implementation of Java

This is my array implementation on stack in Java. It involves push, pop, get and growth when limit of array size is reached. I am a self-taught programmer starting to learn data structures and ...
Carch's user avatar
  • 13
2 votes
2 answers
141 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 ...
E.Etem's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
9