90 Topics
|
|
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 … |
|
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 … |
|
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 … |
|
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 { … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
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 … |
|
[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. … |
|
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 … |
|
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 … |
|
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 … |
|
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. … |
|
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.... |
|
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; … |
|
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 … |
|
[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 … |
|
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 … |
|
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. … |
|
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 … |
|
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. |
|
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 … |
|
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 = … |
|
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 |
|
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 |
|
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 … |
|
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 … |
|
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; } … |
|
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 … |
The End.