1,306 Topics
![]() | |
one way to eveluate a prefix expression is to use queue. to eveluate the expression scan it repeatedly untill you know the final expression value, read it repeatedly untill you know the final expression value. in each scan replace an operator followed by two operands by the calculated value. for … | |
Hi, I have to make a linked-node based priority queue for an assignment. For some reason, however, the enqueue and dequeue just won't work. I have honestly no idea why, because I think the algorithm should work. Can anyone point out the problem? It would be greatly appreciated. [CODE] public … | |
Hello, for this assignment, we have to imitate SW Airline's boarding process. I think I have everything working so far, except for the fact that my program ignores every Passenger entered into the queue except the first one. It's almost as if it bypasses the if statement asking if the … | |
I've been struggling with this for a while. It's not so much a "problem" as it is an approach. I've been working on my client/server socket program and I've reached the point in my planning (which isn't very far in) where I really need to think about how the server … | |
[B]The Producer Thread[/B] What does a producer thread write to the buffer? Create 20 different files (named in0.txt, in1.txt, ... in19.txt). [Testing Hint: you want to be able to tell from the text which file it is from, so the contents should be aaaaaa or bbbbbbb etc..] Vary the length … | |
Hi, Im working on an application that works on a timer. There is a timer on a product, and when the timer expires, the application dispatch the NextProduct method that set the next product in queue to be the active one and resets the timer. The timer is basiclly an … ![]() | |
Hello! I have a minheap class that is implemented as a priorityqueue and it works fine as far as to the iterator that I have to implement as a innerclass. But I can't get it to work properly. Here is part of the code: public class MinHeap<E> extends AbstractQueue<E> implements … | |
I am writing a program that needs to be able to respond to keyboard actions regardless of what application has the focus at the time but after hours of searching the internet I have found no way to do this. for example, the program needs to be able to respond … | |
Can anybody tell me how to handle more number of requests on server using PHP ? If there are 1000 request capability of web server at a time and if more number of requests (say 1500) are encounter on server at a time, then how the SEVER maintains and process … | |
I am using a) Linux b) Pthreads I want to write a program, with two pthreads, to cater for two queues of people. People arrive at each queue at a random interval of 1 - 10 seconds. Each time a person arrives, print out the number of people in each … | |
Hi, I'm trying to write a program that will take an infix notation postifx RPN. My problem is that I can't get it to print out the new equation if someone could try and help me out with that, Iit would be greatly appreciated. [CODE]#include <iostream> #include <queue> #include <stack> … | |
so im tryna save input from stdin to a node. but every time i run the loop it resets whats in my node. idk if that makes sense.. heres my code.. [CODE] #include <stdio.h> #include <string.h> #include <stdlib.h> struct queue_node { char word[11]; struct queue_node *next; } node; struct queue_node … | |
Hi, currently i created a lucene project and currently having a problem with the codes. Here are my codes (which i also refer to some useful websites explain lucene) [CODE] import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.analysis.Analyzer; import org.apache.lucene.analysis.standard.StandardAnalyzer; import org.apache.lucene.search.IndexSearcher; import org.apache.lucene.search.Query; import org.apache.lucene.queryParser.ParseException; import org.apache.lucene.queryParser.QueryParser; import org.apache.lucene.search.Hits; import org.apache.lucene.index.*; … | |
So im working through this and im having troubles finishing it off. Essentially im reading a text file, and tokenizing the numbers in the file, but what needs to be done is for each line in the file to be store in its own Queue, and then the Queue's need … | |
Hi I would like to create a daemon python process in windows which will spawn 8 processes out. Whenever, there is a job, it will be pushed to the queue and the job will be run. If the full 8 processes are been utilised, then the jobs will remain in … | |
Is it possible to read and write to a queue at the same time? for example, one thread is using put() and another thread get() on the same queue? When threading, I've added the task_done() but queue.join() seems to wait for all jobs to finish before the main thread continues. | |
eish am strugling with this binary tree.huffman code and i ave an assignment,have a look on that You are given a text file. Any printable character, including digits and punctuation can be present in the file. Newlines and blank spaces can be present as well. Your job is to write … | |
I am finishing up a program and have a few issues. I get the following error twice in the program... error C2664: 'CreateFileW' : cannot convert parameter 1 from 'char *' to 'LPCWSTR' 1> Types pointed to are unrelated; conversion requires reinterpret_cast, C-style cast or function-style cast Can someone please … | |
I am supposed to create a class patient that will sort the patients according to their condition that is Serious(S), Routine(R), Critical(C), and Expectant (E). Use a heap based Priority Queue. The data type stored should be objects of class Patient. Class Patient will require a compare method that takes … | |
Hey there :) :) :) I'm doing a "simulation" project for the first-come, first-served (FCFS) CPU scheduling algorithm. To give u an idea of what this is: CPU Scheduling is all about having a Scheduler determine which process should be allocated to the CPU next. It has many various algorithms … | |
This is a singlylinked list code.This shows no error but while execution it shows singlylinkedlist.exe has encountered a problem and needs to close thanks in advance [code] #include "singlylinkedlist.h" #include <iostream> using namespace std; class singlylinkedlist //class for linkedlist { private: struct node //struct daclares the abstract data and link … | |
my switch statement is not working properly. it works fine till case 'C', after that nothing is happening. Any ideas? [CODE]void processData(List<Movies>& myList, Stack<Movies>& myStack, Queue<Movies>& myQ){ Movies movieObj; int numInStack = 0, numInQ = 0, num2process = 0; fstream inFile("newReturns.txt"); if(!inFile){ cout << "Unable to open Returns.txt." << endl; … | |
I need to print string (from my textboxes) in a network printer. I can print when the printer is directly attach to my PC while when i print to network printer it gives me NOTHING. Here's my code: [CODE] private void chkPrint_CheckedChanged(object sender, EventArgs e) { //foreach (String printer in … | |
hello, I'm fairly new to programming in general, and i'm having some trouble figuring out how to use a stack and queue to check to see if a word or certain order of numbers/letters form a palindrome or not. My logic is to read in the original string, push/pop characters … | |
could anybody help me pls. the below is the text file. It contains n message flows and n nodes. i have to search each message flows which is available in that text file and if i select any text file it shoukd display the nodes which are available ... could … | |
-List of names in a database -names have double assigned to them, x -each name has random 10 digit double generated from 0 to x -the name with the highest number double is assigned to a variable -if two names generate the same double then the name with in the … | |
![]() | Hi, I have some problem i must to do some homework for our subject called object modeling in java. Award: Add code to the List class. Inserted numbers should be in two way linked lists stored in ascending order sorted, duplicate values are allowed (re-inserting the same value of nothing), … |
hey, this code I wrote wont work. The 2nd and 3rd buttons wont show up in the program. [CODE] #include <windows.h> /* Declare Windows procedure */ LRESULT CALLBACK WindowProcedure (HWND, UINT, WPARAM, LPARAM); /* Make the class name into a global variable */ char szClassName[ ] = "WindowsApp"; int WINAPI … | |
Anyone got codes for the ff.? Frequency count Stack and queue Conversion of infix to postfix using stack binary search tree Anyone? my prof asked us to search for the ff and i thought this would be the best site with the best codes. thanks | |
Hello All! I'm working on a bit of code and I ran into a problem. I am trying to make a program that writes data to a binary file. When the program is run again later (presumably after being terminated) it is supposed to read in the old directory file … | |
Can someone help me with my queue? I think the stack works fine. I just need the indexing of the queue or do I need to index the queue? [CODE]from string12 import * from queue import * def main(): stack1 = Stack() queue = Queue() word = raw_input("Enter a word … | |
We're working on a project and we are completely stuck. Basically, we are coding a virtual Quoridor player module. However, our player module thinks that it's starting one square in front of it's home! Why could this be? [CODE]from interface import * import engine import random import time import copy … | |
Hi there, I'm working on a project which incorporates the following: [LIST] [*]Reading data from XML [*]Writing data to XML [*]Interpreting XML and passing the information to various places [/LIST] These are on different threads, and I've used a Mutex to make sure they don't try opening the main XML … | |
Xp Machine is very slow to boot. I notice that MsMpEng.exe is using up a huge amount of memory during start up process. It goes from about 150,000k to 15,000k. When it reaches the lower figure - which takes some time - things then start to make progress. Also, I … | |
Trying to put the 4 queue.enqueue into a while loop. Any suggestions? Files are attached. [CODE]from string13 import * from queue import * stack1 = Stack() queue = Queue() pallist =[] pallist2 =[] def main(): stack1.push(4) stack1.push('2') stack1.push(1) stack1.push(5) while not stack1.isEmpty(): pallist.append(stack1.pop()) print pallist """while queue.size < len(pallist):""" queue.enqueue(pallist[3]) … | |
![]() | Hello, I wanna write a method that recieves an argument of type String which is a mathematical expression in infix mode, then change it to postfix and store in a queue and return the queue...how do i go about that?? I have created so far a Queue class, Node class. |
why this code doesn't work. I want to do, I have 3 numbers( x1,x2,y1,y2; ) in editbox and it makes an equation y2=x2/x1*y1; and after this what we will receive in y2 it will be writen on hwnd [CODE]#include <windows.h> #include <stdio.h> HWND hwnd1,hwnd2,hwnd3; WCHAR x1[MAX_PATH],x2[MAX_PATH],y1[MAX_PATH],y2[MAX_PATH]; wchar_t str[MAX_PATH]; /* Declare … | |
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 … | |
I need one help.. I have faced problem, while sending XML request to Message Queue. Message has posted to Message Queue(body), but with dot between characters.eg: (T.e.s.t.M.e.s.s.a.g.e) Is there any message format to send plain text? sub sendInbox() { my $Body = shift; #my $Queue = "DIRECT=OS:tandbpc137\\private\$\\testqueue"; my $Queue = … | |
In a iterative deepening search (IDS, why is it needed to regenerate the l levels of a tree when using depth limited searching with L+1 limits? ..my guess is because unlike a queue with n-1 limits, if there was a tree with l+1 limits, then the limit is l+1 because … | |
in my C++ class we were given an assignment (as follows) and i only have one last objective with it. the user is given an option to be able to see the entire queue list and i don't know how to get the program to show that. does anyone know … | |
im doing a college project in c++. it is a token system of bank(line,queue..).it waits for a enter key and then it creates a token with entry time and expected leaving time,cashier to attend to and token no. whenever i compile the program it gives no error but after runing … | |
Hi I need to animate user defined algorithms and I have a myGraph class. The dfs() and bfs() will go into the user-defined algorithm the user types and saves in a text-editor included with my program. I am checking the adjacency matrix to know if two vertex are connected by … | |
I received this error when I tried uploading my game to a website (yes I found one). Java Plug-in 1.6.0_15 Using JRE version 1.6.0_15-b03 Java HotSpot(TM) Client VM User home directory = C:\Users\Adam ---------------------------------------------------- c: clear console window f: finalize objects on finalization queue g: garbage collect h: display this … | |
Hello. The problem with the following code is that when I read from a file after restarting the program and then try to display the contents, it goes into an endless loop. I hope that someone can point out the logical error hiding there. [CODE]#include <iostream> #include <windows.h> #include <fstream> … | |
Q1. What are OSPF packets? What do they do? Answer: There are 5 OSPF packets: Hello: Discover neighbors. DD (Data Description): Exchange LSDB catalog (LSA headers). Request: Ask neighbor to send LSA that I don't have. Update: Send LSA requested by neighbors. Ack: Tell Update sending router that I have … | |
ALGORITHM TO LOAD A JOB IN A FIXED PARTITION 1. Determine job's requested memory size 2. If job_size > size of largest partition Then reject the job print appropriate message to operator go to step 1 to handle next job in line else continue with step 3 3. Set counter … | |
Hi to all! In the following code I am trying to implement a non-directed graph using adjacency lists. Even though there are no compilation errors, I don't get any results. When I am debugging the code it seems that there is a problem when I try to insert a second … | |
Okay, so i was trying to make this work. Two queues need to be created using input from the user for 2 file names. For some reason I get 1 queue, the first one filled. Then the second queue never has anything in it. Please help me with better code, … | |
I'm quite new to the standard template library, I'm trying to understand how to use them with my code. There may still be some logic errors in my code. However I am trying to sort out my syntax errors. One big one is this: type/value mismatch at argument 1 in … |
The End.