82 Topics

Member Avatar for
Member Avatar for Hector_2

I can't get it to compile. I've tried so many things. The errors |29|error: expected unqualified-id before '{' token| |266|error: expected '}' at end of input| |266|error: expected unqualified-id at end of input| ||=== Build failed: 3 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===| Here is the code` #include …

Member Avatar for Hector_2
0
282
Member Avatar for Builder_1

Simulate a patient’s lines using queues with enqueue ( ), dequeue ( ) and printQueue ( ) operations. Define a queue node in the following manner: typedef struct queueNode { int patientID; // Unique identifier; starts at 1; after 24 hours should be reset to 1 int checkupTime; // Random …

Member Avatar for Builder_1
0
374
Member Avatar for Sunil_12

Hello All, I want to write a c++ code to sort a queue with the help of another queue and a non array element. Please help me getting the code.

Member Avatar for Sunil_12
0
593
Member Avatar for phony

|29|error: expected unqualified-id before ‘{’ token| |27|error: new types may not be defined in a return type| |27|note: (perhaps a semicolon is missing after the definition of ‘DynStack<T>::StackNode’)| 46|error: ‘StackNode’ does not name a type| ||In member function ‘DynStack<T>::StackNode DynStack<T>::StackNode(T, DynStack<T>::StackNode*)’:| |40|error: ‘value’ was not declared in this scope| ||In …

Member Avatar for tinstaafl
0
1K
Member Avatar for mystycs

Is there a way to sort a vector with a class that has an int variable? I want to have my vector sorted and printed in console. I want to be able to sort the vectors. Say i create a bunch of vectors here on user input `vector<PCB> Disks2[DiskDevices];` Basically …

Member Avatar for Schol-R-LEA
0
412
Member Avatar for mystycs

Is there a way to mimic creating multiple queues like this but with priority queue? This is what i have but i want to now use a priority queue. queue<PCB> Disks[DiskDevices]; I tried this but it doesnt work. priority_queue<PCB> DisksTest[DiskDevices]; It wont compile? What am i doing wrong?

Member Avatar for mystycs
0
485
Member Avatar for phony

// This program uses the a queue template to create a queue of strings. #include <iomanip> #include <iostream> #include <cstdlib> using namespace std; // // TO CREATE A "template" class named "T" template <class T> // // TO CREATE A CLASS NAMED "Dynque" class Dynque { private: struct QueueNode { …

Member Avatar for phony
0
289
Member Avatar for Humaira_1

I need a help in generating ideas to create a program using stack+queue. Real life example of stack+queue is needed. Pleaseeeee?

Member Avatar for darkagn
0
217
Member Avatar for mystycs

I want to create a queue that holds certain information. I want it to hold multiple peices of information like below. Name, Age, Race, Sex. How can i create a queue FIFO. that holds multiple pieces of information like this that i can access or add into? Thanks!

Member Avatar for David W
0
808
Member Avatar for mystycs

I am trying to print my queue which has values in it. Right now i have this. for(int i = 1; i<ReadyQueue.size(); i++) { } But i am stuck now because i have no idea how to print a queue without popping it off the front. So now i am …

Member Avatar for David W
0
1K
Member Avatar for mystycs

I have a class below class CPU { public: void setPID (int a) { PID = a; } int retrievePID() { return PID; } private: int PID; }; And i am curious if you can create a queue into this class? I am trying to queue in a value into …

Member Avatar for David W
0
341
Member Avatar for thewalrus

public: Queue() : front(0), back(0) {} void put(TreeNode *ptn) { ListNode *tmp = new ListNode(ptn, 0); if (back == 0) front = tmp; else back->next = tmp; back = tmp; } TreeNode *get() { assert(front); TreeNode *result = front->ptn; ListNode *tmp = front->next; delete front; front = tmp; if (front …

Member Avatar for thewalrus
0
207
Member Avatar for Sarfaraz_1

Looking to test my library and implementing it so that insert function can assign the index of the rear in th e ring after the items are inserted in ring class CircularQueue: def __init__(self, size): """ ------------------------------------------------------- Initializes an empty queue. Data is stored in a list. ------------------------------------------------------- Postconditions: Initializes …

Member Avatar for TrustyTony
0
722
Member Avatar for murali2489

Hi Team, Im reading Collections. It is mentioned that while intialising priority queue, it uses natural ordering by default. But my output is not like that. Below is my code and output. public class BackedCollections { public static void main(String[] args) { PriorityQueue<Integer> pq = new PriorityQueue<Integer>(); pq.offer(3); pq.offer(1); pq.offer(5); …

Member Avatar for murali2489
0
3K
Member Avatar for nadiam

there is a very frustrating problem with my queue linked list. the functions all work its just that after enqueue, dequeue or display the menu displays along with "Enter choice : Only one of the above can be your choice ". whats wrong? #include <stdio.h> #include <conio.h> #include <ctype.h> #include …

Member Avatar for nadiam
0
271
Member Avatar for blob84

Hello i implemented this FIFO queue: #include <stdio.h> void enqueue(int *, int); int dequeue(int *); int qempty(void); int head = 0; int tail = 0; int qerror(void); #define N 4 int main(void) { int i = 0; int v[N]; while (i < 10) { enqueue(v, i); i++; } while (!qempty()) …

Member Avatar for Nutster
0
11K
Member Avatar for ktsangop

Hi everyone, I am a C/C++ winapi developer and have to rewrite a "Dialog based" application in java, so that it will execute as an applet in any browser. My java skills are very few, since my knowledge is limited to past college classes. The application is not a large …

Member Avatar for ktsangop
0
367
Member Avatar for tumblinmonkeym

I am trying to implement a priority queue with an unsorted array and hit a wall when I received a Segmentation fault:11. I used gdb and got the error: Program received signal EXC_BAD_ACCESS, Could not access memory. Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000000 0x00000001000017fa in Item<std::string>::setKey (this=0x0, k=3) at PriorityQueueArray.h:27 27 …

Member Avatar for deceptikon
0
865
Member Avatar for fatalaccidents

Hey everyone, I'm new to the concept of stacks and queues. I think I have the basics, but I have a quick question. If I am wanting to swap an object, say x, for another object, say y, in a stack or a queue, is this possible without introducing an …

Member Avatar for bguild
0
222
Member Avatar for marc.punzirudu

ok, im working on an assignment implementing a circular queue (fixed size 15), shared memory, normal producer consumer problem, using three semaphores (one for the queue and one for each process). The objective is to have the producer put the characters from mytest.dat (max 150 chars) into a circular queue, …

Member Avatar for marc.punzirudu
0
2K
Member Avatar for DangleSauce19

Okay so I am having trouble with my depart function. When I output I keep getting 0 for the license plate number and the count for each time a car moves is not right. Any help would be great. Thank you. ____________________________________________ The BASHEMUP Parking Garage contains a single lane …

0
175
Member Avatar for crownedzero

I see this example frequently and thought I'd give it a shot but I've got something unexpected happening with my Queue. I have multiple threads utilizing my producer class but the output doesn't show that it is being written to by each thread. protected Queue<ProductMessage> prodQueue = new ConcurrentLinkedQueue<>(); @Override …

Member Avatar for ~s.o.s~
0
273
Member Avatar for 9tontruck

Here's what I am trying to do: **1. As long as my generic handler gets HttpRequest, push it into a queue and just return empty response so that the request sender does not wait for the long process. 2. A thread keeps checking if there is anything is the queue. …

Member Avatar for 9tontruck
0
435
Member Avatar for FUTURECompEng

public void Enqueue(int value){ node end = endList.next; end.next=null; endList.data=value; endList.next=end; endList=end; Here is my code for an Enqueue method but when I run it mylist.Enqueue(12); It gives me an error. Is something wrong with my method or am I testing it incorrectly? Thanks.

Member Avatar for FUTURECompEng
0
291
Member Avatar for testie

Im having some trouble putting together a linked list implementation of a queue. I'm getting a segmentation fault, which I believe is due to my empty() function because in an attempt to fix my empty() function, I made it determine empty based on (current_size == 0) instead of (front_p == …

Member Avatar for dx9_programmer
0
751
Member Avatar for anisha.silva

hi, so i have a question relating to sending data in a sequence. i have a class evenvent that reads the data from a txt file. that class has to send data to 2 comunication line async and sync. data sent to async is for ex: 'new' . data that …

Member Avatar for caKus
0
231
Member Avatar for anisha.silva

hi, so got a question regargind sending a handler, i have a class for UpdateClient and it has a queue that holds data. this data sould be sent to ether P1 or P2 which are instances of process. Proxy anoher class has to keep track on who is the promary …

Member Avatar for nmaillet
0
173
Member Avatar for SAM2012

I have a queue class code is given below: struct ListNode { ListNode(int value); int value; ListNode* next; }; ListNode::ListNode(int value): value(value), next(nullptr) {} public class queue { public: queue(); ~queue(); bool Empty() const; int Next() const; void Enqueue(int value); void Dequeue(); void DisplayAll() const; int getP() const; private: // …

Member Avatar for SAM2012
0
277
Member Avatar for mobility42

i am trying to load up my ObjectQueue variable objQueue with a task to run some operations on, and there i have a NullPointerException error. the error happens at: `objQueue[0].insert(Task);` I have declared the ObjectQueue variable in a similar fashion on other programs and have had no problem. sort of …

Member Avatar for mobility42
0
292
Member Avatar for superchica08

Combining queue and stack link list? hello so here is my question i ave to connect a link lists together, one who behaves like a stack the other like a queue.the numbers used are 11 22 44 77 33 99 66. so the stack link list looks like this 66 …

Member Avatar for Lerner
0
1K

The End.