24 Topics

Member Avatar for
Member Avatar for Ian_7

Hello All, I am trying to implement a program that takes a prefix expression/string and converts it into a postfix string. I looked up the general algorithim for this converson and tried to implement it myself into this program. The following code is taken from my main java file. My …

Member Avatar for Ian_7
0
1K
Member Avatar for Builder_1

kindly someone to tell me one advantage of a stack backed by a dynamic array over a stack backed by a linked list and one advantage of a stack backed by a linked list over a stack backed by a dynamic array...

Member Avatar for iamthwee
0
156
Member Avatar for Nimalshi

For example, How do I use this custom print method to display something in the main method? public static void print(Stack<String> myStack ) { int count = 1, sizeOfStack = myStack.size(); System.out.println("\nYour stack has size: " + myStack.size()); for (String myString : myStack) {System.out.print(count + ". " + myString); if(count!=sizeOfStack) …

Member Avatar for JamesCherrill
0
223
Member Avatar for eldiablo1121

Hello, I have to write a program which reads in a text file and sees the parsing symbols brackets, parentheses, and braces, and use stack implementation to have a balance symbol checker. My code compiles fine, but the output is strange, I know it has to do something with my …

Member Avatar for JamesCherrill
0
163
Member Avatar for HenryR7

cout << "Enter the filename " << endl; cin >> filename; inFile.open(filename); int length = 0; while (inFile) length++; IntStack stack(length); I keep getting an error and I have no idea why. Can someone explain what is going on with it? After I input the the filename, program terminates. My …

Member Avatar for richieking
0
186
Member Avatar for HenryR7

#include <iostream> #include <iomanip> #include <string> #include <cstddef> #include <cstring> #include <fstream> #include "IntStack.h" using namespace std; int main() { char c; ifstream inFile; string filename; cout << "Enter the filename " << endl; cin >> filename; inFile.open(filename); IntStack stack(50); if (!inFile) //file could not be opened { cout << …

Member Avatar for HenryR7
0
164
Member Avatar for HenryR7

intstack.h cannot be changed class IntStack private: int *stackArray; // Pointer to the dynamically allocated stack array int stackSize; // The stack size int top; // Indicates the top of the stack public: // Constructor IntStack(int); // Destructor ~IntStack(); // Stack operations void push(int); int pop(); bool isFull() const; bool …

Member Avatar for HenryR7
0
147
Member Avatar for troverman

I'm running Exchange 2003 in my company; every 2 days it seems I get a call from a user stating a message is stuck in their outbox or they are not getting new mail. In all cases, restarting the information store and MTA stacks immediately clears the problem and gets …

0
223
Member Avatar for greyfox32

I am working on a project for class. I have to write a program that reads in an infix expression and converts and it to postfix and evaluates it. Currently I have it to where I can convert an infix expression with no parentheses to postfix, but am having some …

0
164
Member Avatar for sobias

Hi guys, Finally I've registered after being a very long visitor for this awesome community. I have this problem which consumed 2 days of my time trying to figure out how to solve it. And your help is needed guys. The problem says: Transfer elemenents from Stack1 to Stack2 , …

Member Avatar for Taywin
0
8K
Member Avatar for jhamill

Hey so this is my code for checking for palindromes...it compiles fine, the problem is it doesnt work. Basically I converted the four sentences into strings without spaces or other characters and added them to a new string called newstr....i used the newstr to check for a palindrome in the …

Member Avatar for NormR1
0
306
Member Avatar for pce369

I am having trouble figuring out how to get a user inputted value into a structure I've created to make a linked list of stacks. The structure and pointer info before main() are: struct inforec { int item; }; struct node; typedef node *PT_NODE; struct node { inforec info; PT_NODE …

Member Avatar for pce369
0
121
Member Avatar for Kathyrine

I wanna convert an integer to a character then i will store it later to the index of a c-string...... something like... int res=123 then it will be putted in.... var[0] = 123 where in var is a cstring, and here 123 is now a char type..... here is what …

Member Avatar for Software guy
0
198
Member Avatar for BoBok2002

I am struggling to write the push and pop functions for a stack of arrays. I know how to write the code to push single items unto a stack and pop them out. Some have suggested that I use an array of arrays (two-dimensional array) to load the array of …

Member Avatar for BoBok2002
0
1K
Member Avatar for beeho

Hi all, I'm having a problem here!! I've attended a lecture on Implementation of stacks in c++ using arrays and it wasn't really hard to understand, but now I'm supposed to know how to Implement a stack using linked list, that's the problem. help please?:confused:

Member Avatar for beeho
0
278
Member Avatar for Santi1986

how many stacks does the kernel maintain/keep track of...say if there are 12 kernel threads and around 50 user processes??

Member Avatar for rubberman
0
197
Member Avatar for BoBok2002

Two things. First I need to resolve the linker errors I'm getting and I also need to learn how to create a text file in a C++ project file. I'm working on a stacks project with classes and I'm running into linker errors. Specifically it says: [B][Linker error] undefined reference …

Member Avatar for BoBok2002
0
366
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 now how abt tht

I have the following code for shell sort (recursive) given in the question where t[ ] is an array to be sorted, n=no of elements initially. h is any large no initially,say h>n. [CODE]void shell_rec(int t[],int n,int h) { int aux,i; if(h<=0) return; if(n>h) { shell_rec(t,n-h,h); if(t[n]<t[n-h]) { aux=t[n]; i=n; …

Member Avatar for Adak
0
499
Member Avatar for choboja621

can you tell me what is the equivalent of: [CODE]flushall()[/CODE] in Turbo c++? Thanks! Im having a problem because of that. Or, what is the header file of it? Thanks AGAIN :D

Member Avatar for Narue
0
115
Member Avatar for intes77

Hello i need help with the popping of stacks. i want to pop them all once i go into the Clear() method, but im having problems with the codings. here's my code: [CODE]import java.util.Stack; class InfixPost { static Stack inputStack; static String output = ""; public String infixToPostfix(String input) { …

Member Avatar for masijade
-1
139
Member Avatar for rockerjhr

i have to impplement a dynamic stack to create a program but when i try to compile my stack.c file(with gcc) I get a bunch of errors here are my files GLOBALS.h [CODE] #ifndef _globals #define _globals #define DATA( L ) ( ( L ) -> datapointer ) #define NEXT( …

Member Avatar for rockerjhr
0
303
Member Avatar for BonnyBonny

Please could you show me how to use stakcs and queue to create a program that divided letters (a,b,c,d,e...x,y,z) by vowel and consonant letters.We have two stacks:in first should be vowel letters and in second consonant letters. Thanks in advance!

Member Avatar for geethasree
0
126
Member Avatar for nwalser

So i am suppose to write two methods called superPop and superPush. superPop() pops a StarLine object from the stack, sends it to System.out.print, and returns it. superPush() pushes a StarLine object onto the stack, sends it to System.out.print, and returns it. I am continuing to try new things but …

Member Avatar for kramerd
0
197

The End.