A queue is an ordered, first-in-first-out (FIFO) data structure. Typical implementations of queues support pushing elements to the back and popping them off the front position.
-2
votes
0answers
15 views
LinkedQueue getNext() doesn't work as intended [on hold]
I have the problem using getNext() proberly as getNext() only gives null back.
...
1
vote
1answer
66 views
Job queue with threading
On many articles and blogs, I have read that exceptions should not decide flow of your code.
I have wrote the following code using one thread:
...
1
vote
2answers
65 views
Implementing a queue using three stacks
This is just for fun so you will see tons of print statements for trouble shooting. I was hoping on slimming this down some and gain new ideas on what I have. This was a challenge question in a class ...
1
vote
2answers
75 views
1
vote
0answers
31 views
Deque implementation [closed]
I tried to implement Deque for Coursera Algorithms . Can anybody tell anything about code?
...
4
votes
3answers
70 views
Implementing a generic Queue in C
I wrote a generic Queue that could with work any data type you give it. The Queue can do any the basic operations that you would expect a ...
1
vote
2answers
55 views
Deque Implementation in Java
Please review my Deque implementation in Java and suggest ways of improving this.
...
1
vote
1answer
39 views
My own Queue Implementation in Java
Please review my Queue implementation and let me know if you have any suggestions. I am not returning an exception for any of the methods defined here. As we know ...
3
votes
0answers
31 views
Checking number of messages in jms queue code
I need to check number of messages in a jms queue for that i am using queuebrowser.
Actually i have 2 queues. I check if there are more then 10 messages in second queue then the first queue should not ...
0
votes
1answer
58 views
Generic Queue (Array and Linked List) Implementation
I am working on brushing up my data-structures knowledge, and was hoping to have my code/thoughts reviewed.
Interface:
...
4
votes
2answers
70 views
Array-based queue implementation
Here I have implemented a queue. Is this a correct, efficient queue implementation? what issues are there if any and what can be done to make it better?
...
2
votes
1answer
83 views
Implementation of Queue using Linkedlist in Java
Can someone please review my code? Is it the correct implementation of a queue? If not, please give suggestions on how to implement it using a linked list.
...
3
votes
3answers
117 views
C++ Queue Implementation
so I wrote a queue implementation in c++ and even though I know the code probably isn't as robust as it should be and probably doesn't perform all the checks it should, I'd like to know mostly if ...
4
votes
3answers
57 views
C Threadsafe Priority Queue O(log n) push, O(1) pop
I wrote this for an A* implementation:
(pqueue.c)
...
4
votes
2answers
84 views
Designing stack and queue from scratch in C
As a beginner and curious guy I'm interested in implementing data structures and algorithms from scratch. Here's my implementation of Stack and Queue, the most fundamental data structures.
Are ...
3
votes
1answer
64 views
Receptive map queue
I've written a class I call ReceptiveMapQueue. Its purpose is to organize the internal structure of an AFKable RPG. It only has two public methods - dumping entries ...
2
votes
0answers
97 views
Request Queue for League of Legends API
I am working on some website for League of Legends statistics, which uses the RiotGames API.
The API allows you to do a maximum amount of requests per 10 seconds, and another maximum amount of ...
4
votes
1answer
80 views
Implement a queue using two stacks
I tried to implement a queue using two stacks. I saw there are questions about this topic, but in my example, I used build-in stack from java. My question is, can someone give me some advice to make ...
4
votes
2answers
58 views
Implementation of a queue for digicode-like system
What it is about
I created an application where you need to push invisible buttons in a certain order to unlock the advanced mode. To handle this, I wanted to use a queue (FIFO) of my own, adapted to ...
3
votes
1answer
84 views
Queue class with enqueue and dequeue
I am just learning swift and tried to make a queue class with enqueue and dequeue.
The node holds the data for each element
The enqueue adds an element to the "queue"
The dequeue deletes the first ...
2
votes
2answers
65 views
Finding the Least Common Ancestor of a Binary Tree
Input a binary tree (the root node) and 2 other nodes that need to be assessed for finding the least common ancestor (LCA)
Code:
a. Finding the nodes first with either ...
4
votes
2answers
94 views
Queue using Stack
I implemented this solution for the problem. Please provide feedback and review if this can be improved in any way.
...
0
votes
2answers
101 views
C++ fixed-size queue full/empty signaling
I'm considering an application where a large data needs to be written to file often. I would like to use a queue and have a producer and consumer running on different threads. Additionally, I would ...
3
votes
2answers
91 views
Queue resizing array implementation
After learning about linked list implementations of a queue I was asked to try a resizing array implementation. I'm looking for constructive criticism.
...
3
votes
1answer
47 views
Queue implementation using two stacks
Here's my code and I want to know if there's a better method for doing so. While the question has stated two stacks I wonder if we could do only with one as well?
...
0
votes
0answers
39 views
3
votes
3answers
45 views
Array-based queue implementation using C
I wrote this header for generic use of a queue. The one thing I'm wondering is if I understood the usage of void*. I hope that if somebody teach me some conventions ...
1
vote
1answer
62 views
Pipeline with std::thread vectors and queue
here is my code, it works but after few iterations it slows down and stop without any error, I'm looking for a more efficient solution.
...
4
votes
1answer
118 views
Implementing Binary Tree using Queue in C#
I am in the process of learning data structures and I am trying to implement Binary Tree using Queue in C#.
Below are my Tree implementation classes.
...
1
vote
1answer
75 views
My Queue implementation is correct?
I have read CLRS Introduction to Algorithms book, now I'm on Elementary data structure chapter. I read about queue concept and try to implement in c.
I have tested a lot it work fine, but I have a ...
3
votes
2answers
86 views
Stack and Queue implemented with a LinkedList
I am looking for feedback on my implementations of Queue, Stack, and LinkedList using Java ...
3
votes
1answer
111 views
MazeRunner in Java - follow-up
I've refined a lot of the code from my previous question, and have also decided to include the logic that interprets a given text file. Any advice on how to improve the actual algorithm that solves ...
3
votes
1answer
150 views
MazeRunner in Java
To test the queue I perfected from one of my CR questions, I've developed a maze program that receives an input maze, starting and end positions, and solves it. I have separate software that handles ...
0
votes
0answers
77 views
Web scraper using Beautiful Soup
I am using Python 3 with Beautiful Soup to scrape web sites. I also used Thread to download images, but it will spend more than 30 minutes to get all information ...
2
votes
0answers
70 views
Blocking Memory Queue
This is a FIFO blocking memory queue in F# to be used as a component in a logging library.
...
0
votes
1answer
39 views
Multi-layer queue
I must write code for my classes which simulates multi-layers production line. But I don't even know how to check if it's good. Can anyone take a look at my code, please? First machine works in random ...
4
votes
2answers
92 views
DoublingQueue in Java
Inspired by this CR question, I decided to create my own queue! If you guys see anything taboo or have any improvements, please let me know. Ultimately I want it to be feature rich and bug free, with ...
11
votes
5answers
552 views
FiniteArrayQueue type with interface and unit tests
Doing some exercises on basic data structures, I learned about queues, and decided to roll my own to better understand how a basic queue can function. As the name indicates, this Queue is made from a ...
1
vote
1answer
45 views
Implement MyQueue using two stacks
I am taking a helper stack, which is used during dequeue. Kindly suggest improvement or some solution with less complexity.
...
2
votes
2answers
135 views
Array-based deque in Java
Are the conditions which I have included for insertion and deletion from front and rear sufficient and necessary? Have I missed some condition check? Or have I included some redundant condition?
<...
4
votes
3answers
160 views
Lock-free SPMC queue
Here is my lock-free queue implementation for single producer with some preallocated memory. T is a simple type with no need for move operations. I don't use ...
3
votes
0answers
103 views
Immutable queue implementation in Scala
I created a queue in which we can perform Enqueue, Dequeue and Traversing in Scala.
...
5
votes
1answer
35 views
Converting Binary Tree to LinkedLists
The problem statement is :
Given a binary tree, design an algorithm which creates a linked list of all the
nodes at each depth (e.g., if you have a tree with depth D, you'll have D linked
...
10
votes
3answers
991 views
Animal shelter simulation using Queues
This is of one the interesting problems I've solved:
An animal shelter holds only dogs and cats, and operates on a strictly "first in, first out" basis. People must adopt either the "oldest" (...
1
vote
0answers
295 views
Are there pitfalls to this solution to read messages from a queue in parallel?
I've posted a question on stackoverflow: How can I consequently read messages from a queue in parallel? I would like my own answer to be reviewed.
Situation
We have one message queue. We would like ...
3
votes
0answers
64 views
Updatable priority queue
This is an updatable priority queue. In contains an index (implemented as std::unordered_map) which maps a value to its position in the queue itself. The queue is ...
6
votes
1answer
76 views
Queue implementation in Java
This is my Queue implementation in Java. Would appreciate a review of the code.
...
6
votes
1answer
191 views
Priorizatable command queue
This code consistently executes commands with a given priority. How can I to improve it?
...
4
votes
3answers
120 views
Implementing CircularQueue using Linked List in C++
I'm currently doing a project, requiring me to implement a CircularQueue data structure in C++:
...
4
votes
2answers
912 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 ...