41 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
59
views
Is circular linked list needed for "Circular" queue?/
I am learning about queue data structure in python. I learnt the implementation of a queue using list in python and the issue of memory wastage when we dequeue a few elements from the front. We use a ...
0
votes
1
answer
83
views
How to achieve maximum throughput without using lock-free mechanism? On thread-safety circular queue
I use two mutexes for enqueueTS() and dequeueTS(), so that writer and reader threads can run simultaneously without waiting for each other. However, both enqueueTS() and dequeueTS() can affect member ...
1
vote
0
answers
106
views
Unexpected Increase in Latency with More Readers in Multi-threaded Circular Queue Implementation in C++
I have implemented a circular queue using an array in C++. The queue uses two atomic variables, front and rear, to manage enqueue and dequeue operations. When an element is enqueued, rear is ...
2
votes
1
answer
512
views
Queue Implementation Using a Circular Array
I have to implement a queue using a circular array and am having difficulty.
This is what should happen:
The enqueue() function returns a bool value: true if the queue is non-full prior to enqueuing ...
0
votes
1
answer
104
views
Why did Donald Knuth say that when implementing a circular queue with sequential allocation, overflow will not be detected when F = 0
In the 2.2.2 sequential allocation section, TAOCP volume 1 , Donald Knuth mentions that F = R = 0 is for the two cases (4) and (5) of the circular queue,
but if we use (6a) and (7a), we should set F =...
1
vote
1
answer
121
views
Inserting a number into a circular queue causes an infinite loop
I'm working on a C program that implements a queue, and I'm encountering an issue with an infinite loop.
The program is supposed to perform insertion, traversal, and deletion operations on the queue.
...
1
vote
1
answer
98
views
I am trying to implement this using a circular queue. My program executes but says terminated succesfully when build&ran
LinkSort.adb file
with Ada.Text_IO; use Ada.Text_IO;
procedure LinkSort is
type JobType is (Accountant, Analysist, Manager, Manufacturing, Programmer, Inventory, Sales, SoftwareEnginner);
...
0
votes
0
answers
72
views
Confusion about enqueue-ing datas into circular-queue recursively
In fact, this is not a main problem, I encountered this issue while doing practice about BST traversal with circular-queue.
I tried to define inorder traversal recursively and so enqueue-ing data also ...
-1
votes
1
answer
41
views
Why does my queue initializing function (c99) returns segmentation fault?
/* Queue structure which holds all necessary data */
typedef struct queue {
int head;
int tail;
void** vals;
int len;
int count;
} queue_t;
/* creates a new queue with a given ...
1
vote
0
answers
189
views
Undefined reference to copy
This is a function for doubling the circular queue capacity in C
(https://i.sstatic.net/xxhah.jpg)
Code source : Fundamentals of data structures in C
#include <stdio.h>
#include <stdlib.h>
...
0
votes
0
answers
325
views
Implementation of Circular Queue using array
So I have to implement a circular queue using array and I've used the following code to do so. However, for some reason when I try to add the 5th element to my queue, it does not seem to work. ALso, ...
0
votes
0
answers
99
views
Handling Unknown user input in C
Circular Queue in C
Currently working on a code that gives us an integer value (1,2,3) along side with a datatype either integer/char/string. Here,
1 -> Enqueue
2 -> Dequeue
3 -> Display
For ...
0
votes
1
answer
190
views
Front and rear pointers of circular queue exceed the size of array
front and rear pointers of circular queue are exceeding the size of array which can be seen in the print statement the input given for size was 3 where pointers go till the value 4 and 6.It would be ...
0
votes
1
answer
549
views
Circular Queue in Javascript
I was going through a book on Data Structures and Algorithm with JavaScript when I found this piece of codes.
I need someone to help me explain the logic behind the code here, also the logic behind ...
0
votes
0
answers
357
views
Popping an element from circular queue in C
So, i tried to delete a particular element in a circular queue, and used its index as front and back. When I ran the code:
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#...