82 Topics

Member Avatar for
Member Avatar for miku003

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 …

Member Avatar for miku003
0
177
Member Avatar for gutchi

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 …

Member Avatar for d5e5
0
246
Member Avatar for tkpanther

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 …

Member Avatar for tkpanther
0
3K
Member Avatar for IamNotSam

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} …

0
70
Member Avatar for monty2831

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 …

Member Avatar for jonsca
0
109
Member Avatar for ace8957

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 …

Member Avatar for ace8957
0
411
Member Avatar for -ordi-

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 …

Member Avatar for -ordi-
0
139
Member Avatar for ace8957

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 …

Member Avatar for caut_baia
0
2K
Member Avatar for ace8957

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 …

Member Avatar for Fbody
0
730
Member Avatar for livesinabox

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 …

Member Avatar for Ancient Dragon
0
107
Member Avatar for crossbow25

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 …

Member Avatar for crossbow25
0
259
Member Avatar for 1989sam

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; …

Member Avatar for mrnutty
0
5K
Member Avatar for coolboym99

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 …

Member Avatar for coolboym99
0
200
Member Avatar for jasleen12345

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 …

Member Avatar for Ancient Dragon
0
120
Member Avatar for surk23

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) …

Member Avatar for tesuji
0
179
Member Avatar for faby

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 …

Member Avatar for TrustyTony
0
2K
Member Avatar for nayay17

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 : …

0
91
Member Avatar for n_angelov

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 …

Member Avatar for xuebao
0
1K
Member Avatar for R3Slick

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

Member Avatar for R3Slick
0
193
Member Avatar for metdos

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 …

Member Avatar for metdos
0
286
Member Avatar for rizzi143

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 …

Member Avatar for rizzi143
0
120
Member Avatar for Gribouillis

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 …

Member Avatar for Gribouillis
0
316

The End.