1,306 Topics
![]() | |
Hi, i made a display()function that uses level-order traversal of the tree to display nodes level-by-level.I was told that I needed to put a queue class in my project. the hint was to put the queue in the root, do regular traversal but when we meet the marker, get() the … | |
Hi i am working swing based applet application which is deployed on a [B]jboss3.2.6[/B] webserver.the jar file [B]application.jar[/B] size is 140kb.i compressed the jar file using sun java pack200 technology as [B]application.pack200.gz[/B] file.now the jar file size is 46kb.the jar is deployed on application.war file with context-path [B]/application[/B] on the … | |
Hi folks, I have a Client (A Till) and a server which I am developing in C#. I wish to implement some sort of network queuing system. So basically, when a method wants to send some data to the server, it will try first and if it fails, then add … | |
[code] void deleteNegative(queue <int> &q) { queue <int> temp; if (!q.empty()) { int x = q.front(); if (x >= 0) { temp.push(x); q.pop(); } else { q.pop(); } } while(!temp.empty()) { q.push(temp.front()); temp.pop(); } } [/code] just afunction that returns a queue without the negatives in the same order. unsure … | |
Hi I've been think about this for a while but the answer eludes me. I know its a pretty simple program but here's the snippet: [code] int main(void){ printf("Enter the operation of your choice\n"); int a; int b; int ch; while((ch = getChoice()) != 'q'){ printf("enter a value: "); if(scanf("%d", … | |
I've tried several times now to write my own neural network class and I think this is the closest I've gotten, the network seems to run properly but it doesn't seem to learn correctly. I'm trying to make it approximate exclusive or but it seems to be only capable of … | |
Hi, I am new to c++ programming.... i am working on a example and when ever i run the following code i get error "Server fifo failure" this is an example and should work alright but error making no sense... :( I am running this code using sun C++ compiler.... … | |
Hello All. I am working on Mac OS X. I installed Python 2.5.4 and Mysql 5.1.31. For the interface, i installed Mysql-Python 1.2.2. I did the right steps for the installation. But , getting some warnings. So, i checked in Python shell for the modules. Python 2.5.4 (r254:67917, Dec 23 … | |
Hey guys, I have been learning c++ while working with memory management i seem to have gotten stuck, There are 2 classes Stack and Queue the stack works on the LIFO principle (last in first out) and the queue the opposite FIFO (first in first out). Now the program runs … | |
Hi, that's my first bigger work in C++. Programm works good but I don't know where I have to alocate memory. And for which structures or something else I have to do alocation? Can anybody help me? Thx. There is my code: [CODE=c++] #include <stdlib.h> #include <ctype.h> #include <stdio.h> #include … | |
Hello there guys, I'm new to C++ and i've got something to ask. I want to create several classes at different .cpp files. But i want to create objects from some of classes at other classes. let me explain it with an example: Main.cpp ClassA.cpp ClassB.cpp These are my cpp … | |
[CODE]Suppose that a stack s and a queue q of characters are initially empty. Show s and q after each iteration of the second for loop of the following code fragment: for(char ch = 'A'; ch <= 'H'; ch++) s.Push(ch); for(int i = 1; i <= 4; i++) { s.Pop(); … | |
Here's my function that i call from main. However i'm getting an error "stackType undeclared" Does anyone know what i'm doing wrong ? [CODE="CPP"] template<class Type> void removeX(queueType<Type>& Q) { stackType<Type> stackQ; while (!Q.isEmptyQueue()) { stackQ.push(Q.front()); Q.deleteQueue(); } } [/CODE] | |
Hey, i set up a circular queue to sort and pass ints easy, but having problems passing struct of information to the queue, wat declaration should i pass to insert function?? Here is my code so far, what would i change the int item to in insert function?? have just … | |
struct Fast_Food_Business { string name; Fast_Food_Business* head; Fast_Food_business* tail; }; struct cash_registers{ Fast_Food_Business * regist; cash_registers * r; } struct Customer { int n; Customer * h ; // head Customer *t; // tail Fast_Food_Business*next; }; bool menu (const char& number) { return number== '1' || number== '2'; } bool … | |
i want to make a prgoram that will read in a set of numbers and determine whether or not they are prime numbers, this is what i got so far any ideas? [code] #include <iostream> #include <queue> #include <vector> using namespace std; int main() { queue <int> input; queue <int> … | |
Hi All, I want to know if it is possible to change the 'Owner' name of a document that gets sent to the printer and is displayed in the Printer Queue Dialog Window? How would I go about doing that? Any Suggestions are most welcome! :) | |
Hey everyone, I'm trying to make it so that my ^ operator is right justified within this binary expression tree. For example, 2^3^4 should be evaluated as 2^(3^4). So I should get 2^81, instead of the usual 2^12. Here is the code I have so far. Everything works, except the … | |
Hi friends Please help me with suitable code snippets to simulate a 2-server queue in C. | |
I'm implementing dijkstra's algorithm, and I'm implementing it using a priority queue so that the shortest distance is on top for fast access. The priority queue uses a vector for its operations. Each node has the following properties: int id int dist Node *path Here is the issue: when I … | |
i'm trying to make this program which simulates a printing queue, a very basic level program that implements priority queues. i'm stuck in the last function, i.e. the simulate function, there's that while(temp!=NULL){...} loop in simulate function which works perfect the first time but turns into an infinite loop the … | |
hi guys.. ive tried to integrate a timer code (which works fine) into a tkinter window but im having errors. can u plz fix it 4 me? thanks. this is the code i want to integrate. [icode] import Tkinter as tk import time def start(): global count_flag count_flag = True … | |
Hi all, I need to convert a JSP file to a PDF file dynamically After converting into PDF , I need to concatenate with another PDF which is already existing and this as a single document to the printer queue.. Please give ur suggestions.. Kindly post some source code which … | |
Hi all, So I've got an assignment of creating a priority queue using a heap data structure. I've read lots of pages online about the heap data structure, but I keep coming up with questions. In my class, I got the impression that a heap was structured similarly to a … | |
I'm getting a RunDLL error on startup that says as follows: Error loading C:\Windows\Qqafeco.dll The Specified module could not be found. After I close the notification box, my computer seems to be running ok, but goes through extremely slow periods where it sometimes takes text I write 10-15 seconds to … | |
Hi, I need a way to do this: One server thread has to read a message from a client thread. The client will send the message to a queue and the server thread will read from this queue. The message being sent will contain: (3 different things) 1-ID of Client … | |
Dear friends, Greetings I am copying the code which is giving only one error. Please help. I have attached the file also.. cross.py [code] import subprocess, sys, socket, time, struct, random from traciControl import initTraCI, simStep, close, getVehNoOfIndLoop, setPhase PORT = 8813 NSGREEN = ["0101", "0101", "0000"] NSYELLOW = ["0000", … | |
I had to implement a priority queue using binary heaps, which I think I have gotten completed, except for one method. We have implement a delete(Anytype X) method which deletes the object x from the priority queue. (It should return false if x is not in the priority queue, and … | |
Working on a simulation which closely resembles waiting in a line at a bank. Program runs the simulation based on the user's inputs of # of servers, simulation time, average time between arrival, and transaction time. Here's what I have so far: [code] /*~~~prog3.cpp~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | | | | | Author: … | |
given a queue: queue<int> myqueue; write a function to remove the last entry in the queue. remark: you can't use stack, pointers, or linked list to do that. You can only use functions such as myqueue.pop(), myqueue.front() etc... Anyone has any ideas? | |
Hello, I need to make this program sort the numbers entered with merge sort then print them. I am having trouble calling merge sort and getting it to print. Here is the code: [code] #include <iostream> #include "queueLinkedList.cpp" using namespace std; /*struct Item : Data { int value; Item *next; … | |
Hello, I am having trouble understanding linked lists. I have to make this program that takes input, stores it to a queue, outputs that input, then sorts it using mergesort and outputs it again. It all works except I'm not sure how to call the mergesort classes. Here is the … | |
Hi everyone, I am a little new to Java programming and am doing a simple project. The Problem is that I am able to connect but am not able to send any data. It is a little weird. The server gets the client's IP and the client to is connecting … | |
Hey guys, Can anyone tell me why this doesn't work in VS2008? I've commented out the #includes and whatnot so you can paste it into a single .cpp file and run it. Here are my errors: [quote]1>test.obj : error LNK2028: unresolved token (0A000320) "int __cdecl eval(class Tree<struct InfoNode> &)" (?eval@@$$FYAHAAV?$Tree@UInfoNode@@@@@Z) … | |
Am working on a big project and am at a particular point within it that requires me to do a couple of things with an array: Array size [1048] 1)How would I break up an array into 10 sections and further divide those sections into 100 spaces u know like: … | |
i have made the following code... but i am having problems in accessing it.. [code] //structure for queue struct queue{ int items[MAX]; int front; int rear; }; //decleration of the queues :que_term for the values printed on the terminal struct queue que_mul2,que_mul3,que_mul5,que_sort,que_write,que_term; //initializing the queue void InitQueue(queue &q) { q.front=0; … | |
if we use queue from c++ stl, we don't need //void enqueue(struct queue *q, int a) //int dequeue(struct queue *q) functions? my TA has it on the slides but since the c++ queue has push and pop enqueue and dequeue isnt needed, right? | |
I'm trying to create a simulation for a service line at a super market. The program builds just fine, but when I run it, I get: "Debug Assertion Failed! Program:... File:c:\program files\microsoft visual studio 8\vc\include\deque Line: 97 Expression: deque iterator not dereferencable" [code=c++] #include "stdafx.h" #include <iostream> #include <queue> #include … | |
I'm new to threading and wanted to make a program that was going to receive data from two separate pieces of hardware and populate a queu with their data. I then wanted to pull the data out of the queue and draw it to the screen graphically. So each piece … | |
csci>g++ -c queue.cpp csci>g++ queue.o project6.cpp Undefined first referenced symbol in file Queue<int>::return_index() /var/tmp//ccHbZwrM.o Queue<int>::enqueue(int) /var/tmp//ccHbZwrM.o Queue<int>::dequeue() /var/tmp//ccHbZwrM.o ld: fatal: Symbol referencing errors. No output written to a.out collect2: ld returned 1 exit status These are my errors. As you can see, my implementation file compiles, but does not compile … | |
Hi basically I've exhausted my mind looking for resources and help on the Huffman Tree Coding. This is my problem, there are 2 parts to what I have to do, the first done: 1. Given a text file, determine the frequency of each character in the text (map of character … | |
Why won't this let me choose my own array size? Queue line[qs_pair] is what i'm concern about. As you can see, I have the user input from the terminal the size of the array. But when I compile it, it gives me an error on visual studio. line unknown size … | |
Hi. I'm trying to learn how to make my own web app and following those tutorials: [url]http://www.netbeans.org/kb/docs/java/gui-db.html[/url] [url]http://www.netbeans.org/kb/61/web/applets.html[/url] I created a desktop application like showed in the first guide. Then tried to integrate it into the Web Applet. But for some reason after right clicking my desktopapp's java file and … | |
I'm trying to write a a program that simulates a multi queues, multi server such as a grocery line at the grocery store. The user will enter the desired number of queue/server pair. how would i write this? I mean, I can have 3 - 4 different queue stacks as … | |
This is for c++. Ok, I have most of this done but can't quite figure out how to get the queue to appear on screen. I also think I may have messed up my loops as well. What it is supposed to do is ask what the user wants to … | |
Im just trying to load a PNG file i created of a background for a game I plan to produce eventually. However im not sure how you go about adding that image to the window. Ive opened up a standard windows app template with the following code. [code]#include <windows.h> /* … | |
Im looking for a code that shows how the directed graph is being implemented in C++ classes.Our teacher told us to use the queue algorithm. all i know is the concept of directed graph and its edge() and vertex(). But to create a program that shows how the direct graph … | |
I am trying to create a system where it has a number of queued slots and it accepts X incoming services. Now each service arrives/departs at different times so i could have one arrive 10 seconds from now and departs 20 seconds after arrival while the one after that could … | |
I am constructing a class "dequeint" of integers and using circular queue storage. I get my code to compile but its output is garbage? Please HELP! .h [code] #include <iostream.h> #include <stdlib.h> const int MAXSIZE = 10; typedef int NodeType; class dequeint { private: NodeType NodeArray[MAXSIZE]; int headi; //head in … |
The End.