90 Topics

Member Avatar for
Member Avatar for kt9871

ran into a little snag with my code. i am trying to push the data of all the nodes in a linkedlist into a stack. problem is, i have no idea how to properly convert a node into a variable. Node current = list.returnHeadNode(); //other code... stack.push(current.getData()); my error lies …

Member Avatar for kt9871
0
322
Member Avatar for DelilahDemented

I have a program that is supposed to match opening and closing braces. It's supposed to work like a stack. It works until the last line of the input file. The last line is matching, but because it thinks the array size is zero it drops out and states that …

Member Avatar for DelilahDemented
0
189
Member Avatar for superchica08

Combining queue and stack link list? hello so here is my question i ave to connect a link lists together, one who behaves like a stack the other like a queue.the numbers used are 11 22 44 77 33 99 66. so the stack link list looks like this 66 …

Member Avatar for Lerner
0
1K
Member Avatar for DangleSauce19

My code works for numbers that dont have a remainder of 10 or above, but whenever I get one with a remainder 10 or above it prints out the number, not the letter. Please help #include <iostream> #include <fstream> using namespace std; const int maxstack = 51; class stack_type { …

Member Avatar for WaltP
0
2K
Member Avatar for greatman05

Here's the problem: I need to implement a stack as an adapter to a List class. I don't know what that means though! I've researched on Google countless times and still don't understand what an adapter is. All the examples I've seen point to using inheritance and then using the …

Member Avatar for greatman05
0
403
Member Avatar for coutnoob

Hi again and thanks in advance !Any help would be very appreciated cause i'm having a test tomorrow and i need some help! So i wanna have a class called Bag and a subclass Set.In bag we have 2 constructors, an insert function , getsize function , getsum (which adds …

Member Avatar for VernonDozier
0
222
Member Avatar for fonzi

Hello I am currently working on this code and the code can be runned well from 100-10,000 random elements after that the heap sort says stack over flow, im thinking the recursive calls are the cause of this, so please healp public static void MAX_HEAPIFY(int [] A, int i, int …

Member Avatar for JamesCherrill
0
307
Member Avatar for gspeach79

Basically I have to **copy array X to the stack frame and dump the stack frame on the screen before return from the procedure.** The problem is I have no idea how to do that. Also I am not even sure my program is right. I was wondering if someone …

0
116
Member Avatar for Kyle Willett

Hi this is a questing from some cs home work. Our task was to take a ada spec file and write the code for the functions and the main program, I have already done this in c++ but am having problems doing it in ada. here is my code: package …

Member Avatar for Kyle Willett
0
603
Member Avatar for Hypnos_16

[I]This exercise will explore the queue and stack data structure implemented with linked lists. The Koch snowflake can be implemented without recursion by using a queue or a stack. Assume that L is either a queue or a stack, L.add( seg ) adds a segment, and L.remove() removes the segment. …

0
106
Member Avatar for balajirs

Below is a part of an experiement. I am trying to mprotect the whole of the stack area but mprotect needs page aligned space. I can get the address of the current pointer using ucontext.uc_mcontext.gregs[REG_ESP] . But how do I get the page-size aligned address to use in the mprotect …

Member Avatar for gerard4143
0
643
Member Avatar for while(!success)

Hey guys, I need help recognizing multiple digit numbers that are read so that I may push said number into a stack for future evaluation For example: 22 3 + should evaluate to 25 When I input 22 3 +, my output is evaluated to 5 Any help/criticism is welcome …

Member Avatar for WaltP
0
2K
Member Avatar for cameronchuck

Hi! I am trying to write calculator in c++ that takes an infix expression, converts it to postfix, and calculates. I have the code that will do this written, but when I try to turn it into a class it gives my a Segmentation Fault. Here is my code... [CODE=c++]//calc.h …

Member Avatar for histrungalot
0
3K
Member Avatar for super-duper

Hey guys, I was just installing the PHP on my laptop. And, on one of the windows, it is asking me if I want the wizard to setup a web server. Do I need one? There is a list: IIS FastCGI, Other CGI, or Do not setup a Web Server. …

Member Avatar for diafol
0
285
Member Avatar for baby_c

hi friends.! need little help. I couldn't find the way to check a stack is empty before pop up a element. when my program is running its give a error. please help me guys.. thank you in advance....

Member Avatar for thines01
0
4K
Member Avatar for mazdasa

actually I had a problem to reverse my string using stack.. can anyone help me? this is a sample of my code : [ICODE]#include<iostream> #include<stdlib.h> using namespace std; void push(); void display(); void pop(); struct words { char data [20]; struct words *next; }; words *head; main() { int i; …

Member Avatar for WaltP
0
251
Member Avatar for mary786

The Question is : Three stacks can be used to sort a list of numbers. Assuming stack in holds the input list of numbers, stack out is to hold the output list after sorting the numbers and temp is used during the sorting process. The sorting algorithm follows. 1 set …

Member Avatar for NormR1
0
201
Member Avatar for alishanvr

[CODE] // Node .h #ifndef NODE_H_INCLUDED #define NODE_H_INCLUDED # include <iostream> using namespace std ; class Node { private: int object ; Node *nextNode ; public: Node() ; void setObject(int x) ; void setNext(Node *next) ; int getObject() ; Node *getNext() ; } ; #endif // NODE_H_INCLUDED //----------------------------------------------------- // Node.cpp …

Member Avatar for alishanvr
0
2K
Member Avatar for fanfunstar

Anyone can help me with this algorithm? 1 set up stack in and print it 2 while stack in is not empty repeat 2.1 max = in.pop 2.2 while there are still element in stack in repeat 2.2.1 value = in.pop 2.2.2 if value > max 2.2.2.1 temp.push(max) 2.2.2.2 max …

Member Avatar for raptr_dflo
0
2K
Member Avatar for kkasp

I've searched all over, but Have not been able to find exactly what I need help on. I am creating a program that takes user input of a word and determines if it is a Palindrome or not....the catcher is I need to use stacks. They are confusing to me. …

Member Avatar for TrustyTony
0
1K
Member Avatar for neelpulse

Hello all, I was trying this problem of checking if the input integers can be ordered using the STL implementation of the stack. The program reads from a file named "input.txt" which in its first line has the number of integers that follow in the second line. The second line …

0
153
Member Avatar for vishal1949

I just wanted to know what would happen if you abuse the CharStack class by pop()ing more characters than you push()? Would it be an error of out of exception or something else.

Member Avatar for JamesCherrill
0
215
Member Avatar for fadeterra

I searched in this forum, but it didnt help my solve my problem. Please help me. This is my code [I]int intOrderNo = (int) Session["sOrderNo"]; DetailsViewRow row0 = DetailsView1.Rows[0]; string strProductId = row0.Cells[1].Text; DetailsViewRow row6 = DetailsView1.Rows[6]; string strUnitPrice = row6.Cells[1].Text; float floUnitPrice = float.(strUnitPrice); string strQty = DropDownList1.Items[DropDownList1.SelectedIndex].ToString(); int …

Member Avatar for fadeterra
0
327
Member Avatar for babis87

Hello! I am making a program which does many computations for a Photovoltaic system. The problem is that i get a strange segmentation fault error when I run the program. Here is where it crushes (at for-loop of calculation S5) : [CODE] commands..... ... ... /******************** WIRING *******************************/ Ni = …

Member Avatar for Salem
0
2K
Member Avatar for iamuser_2007

hi i know positive examples for > stack unwinding, > constructors, destructors and exceptions handling, > exceptions and inheritance. tell me some negative examples of these. thnx for guidence

Member Avatar for mitrmkar
0
75
Member Avatar for iamuser_2007

Tell me about these and give me some negative and positive code examples. >>Stack Unwinding >>Constructors, Destructors and Exception Handling >>Exceptions and Inheritance thnx for information

Member Avatar for ichigo_cool
0
119
Member Avatar for ocramferreira

Hi all, well my problem isn't a practical problem. I have a project to do which is a word game.First of all i have a .txt (a dictionary) my program has to fetch a random word and shuffle it. With the combination of those letters the program has to find …

Member Avatar for iamthwee
0
561
Member Avatar for montjoile

hi. Im trying to make an expresion tree for every ER that I read each ER will be transformed into postfix and saved in a string, which I'll be sending to arbol_expresion() to create it`s tree expression Searching on the web I found a method to convert the postfix expresion …

Member Avatar for abhimanipal
0
129
Member Avatar for c0ld sn1ff3r

Hi, I need to develop a C# console application which implements stack as a circular queue. I've written the code to use stack as a simple queue. [CODE]using System; public class Stack { private int[] theArray; private int topOfStack; public Stack() { theArray = new int[10]; topOfStack = -1; } …

Member Avatar for ddanbe
0
756
Member Avatar for flowerzink

Hello there people, I hope you can help me with this one. I'm having a very serious problem when using the Top() method of a stack, difined like this: [CODE]template<class T> T Stack<T>::Top() const {// Return top element. if (IsEmpty()) throw OutOfBounds(); // Top fails else return stack[top]; }[/CODE] and …

Member Avatar for flowerzink
0
253

The End.