82 Topics
| |
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 … | |
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 … | |
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. | |
|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 … | |
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 … | |
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? | |
// 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 { … | |
I need a help in generating ideas to create a program using stack+queue. Real life example of stack+queue is needed. Pleaseeeee? | |
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! | |
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 … | |
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 … | |
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 … | |
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 … | |
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); … | |
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 … | |
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()) … | |
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 … | |
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 … | |
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 … | |
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, … | |
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 … | |
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 … | |
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. … | |
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. | |
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 == … | |
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 … | |
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 … | |
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: // … | |
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 … | |
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 … |
The End.