82 Topics
| |
I'm trying to make an array-based queue that inserts and removes the elements... The default array is {0,0,0,9,10}. after the 0's are filled up it should say that its Full and will return to the loop. I'm having trouble making 3 particular methods which is dequeue, isEmpty, and isFull.. [CODE]class … | |
Hi Everyone! I have here a queue: [CODE]my $qTool = Thread::Queue->new();[/CODE] I want to show all the elements that the queue contains. [CODE]my $qItem = $qTool->peek();[/CODE] The code above returns only either the head of the queue or an element at a specified index. Is there a way for me … | |
Hello everyone, It has been a while since I last logged on. It has been a while since I really needed any major help in programming. But I am here now and I do need a bit of help. Let me start off by saying that I have tried to … | |
Hi, I have a task which involves using a queue in order to fill an enclosed region. For example I have chosen this 2d array to apply a flood fill technique to. [CODE] int[][] shape ={ {X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X,X}, {X,X,X,0,0,0,0,0,0,0,0,0,0,0,0,0,X,X,X,X}, {X,X,X,0,X,X,X,X,X,X,X,X,X,X,X,0,X,X,X,X}, {X,X,X,0,X,X,X,X,X,0,0,0,0,0,0,0,X,X,X,X}, {X,X,X,0,0,X,X,X,X,0,X,X,X,X,X,X,X,X,X,X}, {X,X,X,X,0,X,X,X,X,0,X,X,X,X,X,X,X,X,X,X, {X,X,X,X,0,X,X,X,X,0,0,0,0,X,X,X,X,X,X,X}, {X,X,X,X,0,0,0,0,X,X,X,X,0,X,X,X,X,X,X,X}, {X,X,X,X,X,X,X,0,X,X,X,X,0,0,X,X,X,X,X,X}, {X,X,X,X,X,X,X,0,X,X,X,X,X,0,X,X,X,X,X,X} {X,X,X,X,X,X,X,0,X,X,X,X,X,0,X,X,X,X,X,X} {X,X,X,X,X,0,0,0,X,X,X,X,X,0,X,X,X,X,X,X} {X,X,X,X,X,0,X,X,X,X,X,X,X,0,X,X,X,X,X,X} {X,X,X,X,X,0,0,0,0,0,0,0,0,0,X,X,X,X,X,X} … | |
Hi, i have no idea how to go about doing this iv tried coding it a bit but just get very confused! if anyone could give me a hand or show me some sample code would be great. Thank you Create a program which: Implements a class called Queue: The … | |
Hi all, I've been working on making a bounded priority queue implemented as an array of queues and I believe I have it at last -- except of course for this error that I don't understand... I am getting an error about the queue array being declared without a type … | |
Input: A, B, C, D, E ... [CODE] 1/1 1/2 2/3 3/4 2/5 [/CODE] Output (Queue!): [CODE] 5 B 1 E 3 C 4 D 2 A [/CODE] How to make this? Mark competitors (persons) Example: A ... E their come in first queue. A can label/tag 1/1. B can … | |
Hi all, So I'm working on this program to use a circular doubly linked list to implement a queue class. It went fairly well, but I'm stuck on the copy constructor, which causes runtime errors whenever I try to test it. Nonetheless, I really don't see what I am doing … | |
Hello all, So I'm working on this simple program with a Queue class template that is publicly derived from the abstract base class CharQueue. The only problem is that I keep getting hit with the error "expected class name before '{' token". The reason I don't understand this is that … | |
So my Turbo C doesn't handle errors. And in school we used VC++ but I don't have it at home. So can anyone tell if the code snippets for Queue and Dequeuing a Queue and Pop and Push operations in Stack are right? [CODE]\int queue::dequeue() { try { if(front>rear) throw … | |
SinglyList.h [CODE] #ifndef SINGLYLIST_H #define SINGLYLIST_H #include <iostream> #include <string> using namespace std; class Exception { private: string errMsg; public: Exception(const string& err) { errMsg = err; } }; class InvalidPositionException : public Exception { public: InvalidPositionException(const string& err) : Exception(err){} }; class EmptyException : public Exception { public: EmptyException(const … | |
I'm trying to put a 2 dimensional array in a queue... How could I do that? #include<iostream> #include<queue> using namespace std; struct state { int puzzle[2][2]; }; int main() { state p; p.puzzle[0][0]=1; p.puzzle[0][1]=2; p.puzzle[0][2]=3; p.puzzle[1][0]=8; p.puzzle[1][1]=0; p.puzzle[1][2]=4; p.puzzle[2][0]=7; p.puzzle[2][1]=6; p.puzzle[2][2]=5; queue<int> Queue; Queue[front] = p; while(!Queue.empty()) { cout<<" "<<Queue.front()<<endl; … | |
I'm writing up a program for a class I'm taking where I need to make a linked list stack & queue. Right now I'm not quite done, but I'm having problems calling the functions from the .h file. What's happening is in the while loop, I'm trying to get data … | |
this is a program that my teacher gave me in the class. but i didn't understand it....please explain it to me step by step... [code= c++] #include<iostream.h> class queue { int element; queue* next; public: queue* enqueue(queue*,int); queue* dequeue(queue*); void queue_display(queue*); }*head,*tail,object; queue* queue::enqueue(queue* head,int key) { queue* temp; temp=new … | |
I kind of understand the basic concept of adding to the end / overwriting the oldest when the buffer is full, but i am not sure about where to add new data in the buffer when there is free space at the start of the array (the left hand side) … | |
hello everyone! I wanted to create a priority queue in which there would be different dictionaries with their priority numbers. The major problem I'm experiencing is that the queue just prints the dictionaries without regard for their priority. Please what do I have to do so that the queue prints … | |
Dear All, Could you tell me how to complete this coding? so it can run like the program that I have attached. Cheers, [CODE] type node = ^data; data = record nama : string; ipk : real; {tipe data info} yudisium:string; next : node; end; linkedlist = record first : … | |
Define a class Queue_time that represents a queue of Time objects (from our textbook) by keeping its elements in a dynamically allocated array (with maximum capacity) and make the queue as a "circular array" (the first element follows the last one). Supply the "big three" memory management functions. Use this … | |
does someone know a code in c that will send a complete ASCII file in 128 byte packets to another file? So The sender takes the ASCII file as input and sends a 128 byte packet on the data queue | |
Hello Everyone, I'm trying to implement a Polymorphic Queue. Here is my trial: [CODE]QQueue <Request *> requests; while(...) { QString line = QString::fromUtf8(client->readLine()).trimmed(); if(...)){ Request *request=new Request(); request->tcpMessage=line.toUtf8(); request->decodeFromTcpMessage(); //this initialize variables in request using tcpMessage if(request->requestType==REQUEST_LOGIN){ LoginRequest loginRequest; request=&loginRequest; request->tcpMessage=line.toUtf8(); request->decodeFromTcpMessage(); requests.enqueue(request); } //Here pointers in "requests" do not … | |
create a C++ program, using a queue that will interface to your car, to read out to you directions as you drive. You have been at a hockey game at Rexall Place. So you ask your GPS for a route home to your residence at King’s. You enter each instruction … | |
When several producer threads put items in a queue.Queue, and a consumer thread gets items from the queue, there is no way for the consumer thread to tell the producers that they should stop feeding the queue. This snippet defines a subclass of Queue with a close method. After the … |
The End.