1,306 Topics

Member Avatar for
Member Avatar for patsfan

He guys, I am trying to figure out what is wrong with this code for level traversal in binary tree in C. I would really appreciate any help or suggestion or changes in my code. [CODE] status level_traverse( tree T, status( *p_func_f ) () ) { tree *node ; queue …

Member Avatar for abhimanipal
0
118
Member Avatar for tyliang

Error at line 56 and 68. Unable to resolve it. [code=c] #include<stdlib.h> #include<stdio.h> #include<ctype.h> #include<string.h> #include"stack.h" #include"queue.h" #include"calcstack.h" #define MAXSIZE 80 void intopost(stack *stackPtr, queue *queuePtr, char expression[]); void pushvalue(queue *queuePtr, char item); void pushop(stack *stackPtr,queue *queuePtr,char item); void noBracket(stack *stackPtr,queue *queuePtr,char item); void removeBracket(stack *stackPtr,queue *queuePtr,char item); int precendence(char …

Member Avatar for mitrmkar
0
250
Member Avatar for rizzi143

// hi guys actually i need some suggestion or help .. i want to add STRING capability in this following Queue program. currently it just eccepts the chars . so if somone can help me out in getting the String output. thanks [CODE]#include "stdafx.h" /***** Structure template *****/ struct list{ …

Member Avatar for Ancient Dragon
0
130
Member Avatar for Etherwind

I wrote a function to read an expression (i.e. A+B-C) from the keyboard one character at a time, and ignoring spaces insert each char into a queue. I tried something I though would be fairly elegant, but I don't think I did it right. This is my function: [code] void …

Member Avatar for WaltP
0
104
Member Avatar for mikabark

I'm doing school assignment. But I can't solve it yet. Will you help me? Using shared memory,I have to copy structure to second program. But it does not operate well. Maybe it's type problem especially shmat part. Will you help me guys? Thanks you in advance. [CODE]struct work_list { int …

Member Avatar for Ancient Dragon
0
384
Member Avatar for Yeen

I have to use a queue in an solitaire assignment, but I'm having some trouble using the linked list Queue class that I made. It won't take arrays at all. [code] class Testing { public static void main (String [] args) { Queue testlist = new Queue(); // testing Queue …

Member Avatar for lafigueroa
0
795
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
123
Member Avatar for theonlywalks

Hi everyone, I have searched high and low across google, even throughout my textbook... I have this project where you have to design the different types of CPU schedulers. If there are three processes (arriving in this order), P1, P2, P3, and each process has a CPU Burst, then an …

Member Avatar for Salem
0
134
Member Avatar for ChPravin

Hello All, Is there any way to completely test a Circular Queue Implementation?I have written an array based implementation and need to know if it works for all the cases.I was just wondering how to come up with exhaustive set of test cases to test the code instead of the …

Member Avatar for ChPravin
0
582
Member Avatar for imclumsy

Hey guys, I am trying to read a skel file and create a skeleton from it, but I don't understand how to do the joint class. Here is what i have now: this is the main class. [code] public static void main(String[] args) { // Frame frame = new Frame("Simple …

Member Avatar for emilo35
0
164
Member Avatar for CaninA

anyone can do case statment for stack , queue and linked in one program plz ex: void main () do { cout << "1 - stack"; cout << "2 -queue"; cout << "3 - linked list "; cout << "4 - stack with linked list"; cout << "5 -queue ....... …

Member Avatar for uchihakyu
0
260
Member Avatar for kikat

I need to print the level order traversal of an AVL tree. I know how the idea works using a queue: enqueue the node, and then enqueue the left and right nodes of it. every node has a int data which needs to be printed but then the thing is …

Member Avatar for mrnutty
0
117
Member Avatar for GradStudent

How does Priority Queue work. This is my scenario, I have certain objects with priorities 1,2,..10. There could be multiple objects with same priority. I was thinking I can put them into a priority queue and let the pool() give me the objects with highest priority.. ? I m kinda …

Member Avatar for GradStudent
0
162
Member Avatar for aayushssinghal

i want to implement queue in scheme with out increasing the complexity of the algorithm. Right now for inserting an element at the end of the queue i need to travel through whole queue. that makes insertion O(N) process. pls help me with this.

-1
52
Member Avatar for freakzilla

Hi guys, I have been trying to implement a shared circular queue between 2 processes. My structures are as follows: [code] typedef struct client_entry { long shmid; int pid; struct client_entry *next; struct client_entry *prev; } client_entry_t; typedef struct client_queue { unsigned int num_entries; long current_shmid; int notify; struct client_entry …

Member Avatar for Salem
0
170
Member Avatar for karolik

So I have a LinkedQueue which is a queue that is implemented by LinkedList. I need to overload the = operator for LinkedQueue. [CODE]LinkedQueue& LinkedQueue::operator=(LinkedQueue& queue) { return *this; }[/CODE] As you can see Linked Queue is const...the problem is that in order to copy the content from queue to …

Member Avatar for mattjbond
0
117
Member Avatar for marcux

Hi all! I am building a small app with pygtk as the gui. I have a thread that communicates over the network and when the user clicks a button I want a variable to be updated in my communication thread. I have made a class that subclasses Thread: [CODE] class …

0
49
Member Avatar for jonyb222

Arrival.o: In function `NodeItem': /home/jonyb/Desktop/A3-Q2/NodeItem.h:5: undefined reference to `vtable for NodeItem' Arrival.o: In function `~Event': /home/jonyb/Desktop/A3-Q2/Event.h:8: undefined reference to `NodeItem::~NodeItem()' Event.o:(.rodata._ZTI5Event[typeinfo for Event]+0x8): undefined reference to `typeinfo for NodeItem' These 3 errors repeat themselves for all my files accessing NodeItem.h and NodeItem.cpp Now I've looked around and all I could …

Member Avatar for jonyb222
0
8K
Member Avatar for jonyb222

Good afternoon Daniweb, I have a simple (and probably idiotic) problem today, I have a simplistic program that simulates a Train station, trains come in, they go into a stationDock and come out after a while. The stationDocks are an array of trains, either pointing to a train or being …

Member Avatar for jonyb222
0
3K
Member Avatar for tonymate

Hi all, Below is a program that continues to give me multiple errors when I ran it. I kept getting error which I don't know how to fix and where/or what I did wrong. I need your help. Please bear with me as you read through this because it is …

Member Avatar for dreamcode
0
281
Member Avatar for gplkrsna

Hi, Problem: I have two libraries with two different queue implementations. but with same structure name as "queuetype". Now if I include both of the header files in my code, compilation will go for toss saying "error: conflicting types for 'queuetype' " I need to include both the files. How …

Member Avatar for Narue
0
125
Member Avatar for cs_stud

Hi! I'm a BSCS student and currently working on an assignment about queues. We were tasked to solve a bank simulation problem. I got the header files for the teller and customer and both compiled successfully. Here are the header files: Customer header file: [CODE] //Header file cust.h #include <stdlib.h> …

Member Avatar for cs_stud
1
618
Member Avatar for Khazidhea

Hello, First of all, excuse my English =) Warning: wall of text\code. I must say I have some experience in Java and long forgotten C++, so right now I have some problems implementing the Huffman coding. The algorithm goes like this: I create an array of 255 elements to represent …

Member Avatar for Khazidhea
0
240
Member Avatar for jackjones

i am having great difficulty on one of my assignments. AM I NOT ASKING FOR THE CODE, I AM JUST ASKING FOR SOMEONE TO POINT ME IN THE RIGHT DIRECTION SO I CAN DO SOME RESEARCH AND DO IT MYSELF. The specifiaction says " Different locations will be respresented by …

Member Avatar for ddanbe
0
221
Member Avatar for pinsickle

[CODE]current = queues[i];[/CODE] This line of code is killing me. I am suppose to be doing a write method for an array based priority queue. However I cant seem to get the first node on the give part of the array. queues is of the Queue class which is a …

Member Avatar for pinsickle
0
139
Member Avatar for rwill357

I am new to binary trees. I have been given the task to write functions to count the number of nodes, to count the number of leaves in nodes, to count the number of right children, to find the height of the tree, and to delete all the leaves of …

Member Avatar for WaltP
0
171
Member Avatar for terabithia

Hi.. I suppose to have a programe to read a data from a file and enqueu it to the Queue. The programme works like a Priority queue whether the ladies queue need to be inserted to queue first before the gentleman... But i think i need to try first how …

Member Avatar for scott.vass
0
3K
Member Avatar for DiaaHedo

Dear all, Good Day I need your help, I have the attached files that contain a data for "queue system" and I can get report from them by the q-system application But I search for another way to open this file as (SQL, Access or other) If you can open …

Member Avatar for karol33
0
124
Member Avatar for Ana_Developer

Before I proceed with the code implementation, I need to find the error that this program initiates. I can't figure out the solution, I guess thats what happens after not using c++ for 4 years... The compilation errors I'm getting are all of this type (11 of them): Error 9 …

Member Avatar for Ana_Developer
0
198
Member Avatar for Ana_Developer

I cant find the error here.. [CODE]#include "stdafx.h" #include <deque> #include <list> #include <queue> #include <iostream> #include <fstream> #include <string> #include <sstream> #include <set> using namespace std; char file_name[15]; char links_file[15]; char alg[15]; char with_list[15]; char new_name[15]; int depth; long idstart,idgoal; class Action { public: long start_node; long end_node; int …

Member Avatar for Ana_Developer
-1
225
Member Avatar for Dani

[B]ADT.h[/B] [code] struct process { int pid; // process id char* file_name; // file name of the process to be run int cpu_time; // amount of time the process needs with the cpu int request_priority; // priority from 1-5 (higher is better) int pr; // adjusted priority rate }; /**********************************************************************/ …

Member Avatar for Fbody
0
1K
Member Avatar for gowth08

Hi all, My code for SHOP is as follows, problem description [url=http://www.spoj.pl/problems/SHOP/]here[/url]. [code]#include<iostream> #include<queue> #include<climits> using namespace std; class pt{ public: int _x,_y,_cost; pt(){} pt(int x,int y,int z):_x(x),_y(y),_cost(z){} int print(){ printf("%d %d %d\n",_x,_y,_cost); } }; int dx[]={0,-1,0,1}; int dy[]={-1,0,1,0}; int main( ) { int M,N; while(scanf("%d %d",&N,&M)!=EOF){ if(!M&&!N)break; bool flag=false; …

Member Avatar for Ancient Dragon
0
167
Member Avatar for bhushnxx

In this assignment a scheduler algorithm needs to be designed and implemented. The scheduler designed will be used for scheduling different tasks/process to be executed in a system. There are different kinds of processes in a system. When the process enters the system it will be directly stored in the …

Member Avatar for Ancient Dragon
-5
133
Member Avatar for Godflesh

Hello i have a big problem, i want to import queue but i get this message, somehow it dont exist. Traceback (most recent call last): File "D:\Python26\test.py", line 9, in <module> import queue ImportError: No module named queue isnt that strange.

Member Avatar for Godflesh
0
16K
Member Avatar for flying_bird

Hi guys, I am looking for an STL solution for the following problem. The desired behaviour is the following: - It should act as a priority queue - When an item is added, the item with the *lowest* priority should be dropped. I thought of doing that by making a …

Member Avatar for flying_bird
0
173
Member Avatar for sirdanman10

Does anybody know a good tutorial on programming applications with multiple entry points in C++? I am designing an application in MSVC 2008 Express that will interface with an AS/400 system and process scripts to either feed data, extract data by reading the screen, or do custom tasks. I was …

0
120
Member Avatar for safenaa

i want to know how make dequeue in queue . please, the answer with a complete program. thanks,,,,,,,,,,,,,,,,,,,

Member Avatar for jonsca
0
39
Member Avatar for xavier666

I just made a 'Hello World' program [code] #include<stdio.h> int main() { printf("Hello World\n"); return 0; } [/code] [code] exe file size = 15.5 KB Source file size = 79.0 B [/code] Then i made a data structure program (implementing stack, queue, deque) [code] exe file size = 21.9 KB …

Member Avatar for xavier666
1
176
Member Avatar for jakethesnake86

I'm completely new to java and am trying to get some experience with programming java applets that can be opened from a browser. I was able to successfully open a simple "hello world" applet from a browser using the below javascript: [CODE]<script src="http://www.java.com/js/deployJava.js"></script> <script> var attributes = { code:'HelloWorld.class'} ; …

Member Avatar for jakethesnake86
0
700
Member Avatar for FX2236

Hi IM trying to make a queue of Byte[] every time i click on a button , Very Strait Foreword [CODE]System.Collections.Queue Myqueue= new System.Collections.Queue(20); public byte[] Bytearray = new byte[2]; Myqueue.Clear(); while (Myqueue .Count !=20) { Temp=Calc(Bytearray); Bytearray[0] = temp[8]; Bytearray[1] = temp[13]; Myqueue.Enqueue(Bytearray); }[/CODE] So the Loop is done …

Member Avatar for sknake
0
202
Member Avatar for padrict

I'm trying to get two divs to line up side by side hoping it will solve my issue. I have two tables of expandable lists. when a section in the first div is selected, the second div moves with the expansion. I've tried setting the second div to position: absolute …

Member Avatar for ljianyih
0
137
Member Avatar for saintrenz

Can you guys check my work i want to perfect my studies at school.. this will be passed on sunday also there some that dont have answer which you know please do tell.. [QUOTE]False 1. When you go through a list of names, from beginning to end, until you reach …

Member Avatar for ryoumah03
0
204
Member Avatar for xyzt

Hello, I try to use POSIX Message Queue API and in the doc it says that: [CODE]#include <mqueue.h> int mq_send(mqd_t mqdes, const char *msg_ptr, size_t msg_len, unsigned msg_prio); [/CODE] [I]The mq_send() function shall add the message pointed to by the argument msg_ptr to the message queue specified by mqdes. The …

Member Avatar for kbatra
0
907
Member Avatar for ellimist14

I realize no one is going to want to read through this source code but if anyone does and is able to tell me why I'm getting the errors I'm getting I would be extremely grateful and would pay them back somehow. My code is as follows (I just put …

Member Avatar for shaneselling
0
139
Member Avatar for johndoe444

[CODE] typedef struct tag_linked_list linked_list; struct tag_linked_list { int value; linked_list* next; }; typedef struct tag_list list; struct tag_list { int size; linked_list* data; }; void list_insert(list* lst, int x) { printf("lst->data %p\n",lst->data); lst->size++; // create a new node linked_list node; node.value = x; node.next = lst->data; // make it …

Member Avatar for johndoe444
0
105
Member Avatar for zainhamza

hi, I'll be greatful if someone tell me how to declare the preiority queue in c++ and also tell me the syntax that how we can put a node in a preority queue. Regards Zain

Member Avatar for Narue
0
220
Member Avatar for lotrsimp12345

we are supposed to implement using STL vector and base it on priority and have have a data value So every time i enqueue i insert an in item into the end of the vector and if no space i modify. So do i reorder the list to place the …

0
67
Member Avatar for miag

[CODE]#include "queue.h" #include <cstdlib> using namespace std; void queue::sort() { Node *nodeLeft, *nodeRight; double temp=0; int nofswaps=1; if(size>1)//check that at least two nodes exists in the queue { while(nofswaps>=1) { nofswaps=0; do { nodeLeft=pFront;//nodeLeft first time points to the first node of the queue and then points to next node …

Member Avatar for gastonci
-4
92
Member Avatar for NinjaLink

I am writing program segments (not real programs or functions) to make sure if I understand how to do each one by using "push/pops for stacks" and "addQueue and DeleteQueue for Queues". Can someone please help me with these questions. I don't know if I am correct or not! 1. …

0
67
Member Avatar for ericcool

Required to use PriorityQueue to implements Dijkstra’s algorithm for solving the single-source shortest-path problem for weighted graphs without negative edge weights. I have a wrong output of my program. Here's the code: [CODE] //Graph.h class Graph { public: Graph(int r = 1, int c = 1); // constructor void setCost(int …

Member Avatar for ericcool
0
145

The End.