Menu
Menu
DaniWeb
Log In
Sign Up
Read
Contribute
Meet
Search
Search
About 73 results for
linkedstack
- Page 1
toString() Method for a LinkedStack
Programming
Software Development
10 Years Ago
by Pyler
… onto the current stack. So I have something like public
LinkedStack
<T> copyStack(){ //code goes here } To …test my code I created a
LinkedStack
<String> object and pushed items onto it. I… then used some of the
LinkedStack
methods to modify and printed the final results But …
Defining a generic LinkedStack Constructor
Programming
Software Development
10 Years Ago
by Pyler
I'm having trouble pinpointing the exact definition of a generic
linkedstack
class Suppose I have public class
LinkedStack
<T> { //some variables //would this be right
LinkedStack
(){ } //for a generic constructor of type T for the
LinkedStack
class of type T? }
is it possible that a LinkedStack will be full?
Programming
Software Development
15 Years Ago
by l_03
hello...i am confused,,it is possible that a
linkedstack
will be full??i only implement a method that isEmpty(),,and it reads the method if the stack is empty..but if the stack is full, it do not even read the method i made....would someone help me?/,,,thank you ahead...
Re: is it possible that a LinkedStack will be full?
Programming
Software Development
15 Years Ago
by Antenka
I hope, this may help you: [url=http://books.google.com.ua/books?id=UPhrjggcTwwC&pg=PA355&lpg=PA355&dq=java+
linkedstack
+isfull&source=bl&ots=mKcXZrHuAB&sig=9UfF5qRYyjliq25ONNmqm-SZQxo&hl=ru&sa=X&oi=book_result&resnum=1&ct=result#PPA355,M1]Object-Oriented Data Structures Using Java[/url]
Re: is it possible that a LinkedStack will be full?
Programming
Software Development
15 Years Ago
by verruckt24
…;774868]hello...i am confused,,it is possible that a
linkedstack
will be full??i only implement a method that isEmpty…
Re: is it possible that a LinkedStack will be full?
Programming
Software Development
15 Years Ago
by ~s.o.s~
…;774868]hello...i am confused,,it is possible that a
linkedstack
will be full??i only implement a method that isEmpty…
Re: toString() Method for a LinkedStack
Programming
Software Development
10 Years Ago
by stultuske
ig you hry those 'pointers', that means you are calling the toString method on an instance of a class which didn't override the toString method, but rather uses the one provided by the Object class. not sure whether you'll have a foolproof solution for this, since you are using a 'default generic', which would allow any class, so you won't be able…
Re: toString() Method for a LinkedStack
Programming
Software Development
10 Years Ago
by JamesCherrill
Sounds like you may be printing your stack elements (ie your class with a data item and the pointer to the next elements)? If so you need to provide a toString method for that class, in which you could return something like `"List element: " + theDataItem`. The string concatemation will automatically call the data item's toString method…
Re: toString() Method for a LinkedStack
Programming
Software Development
10 Years Ago
by Pyler
I'm lost.
Re: toString() Method for a LinkedStack
Programming
Software Development
10 Years Ago
by Pyler
Figured, rather found the soln String=""; Node<E> current=top;//Node current=top for non generic stack while(current!=null){ result=result+(current.getData()).toString+"\n"; current=current.getLink(); } return result;}
Re: Defining a generic LinkedStack Constructor
Programming
Software Development
10 Years Ago
by JamesCherrill
Yes
Integer Stack Copy Function
Programming
Software Development
16 Years Ago
by SHWOO
…"; }
linkedStack
::
linkedStack
() { stackTop = NULL; } //end constructor
linkedStack
::
linkedStack
(
linkedStack
&otherStack) { stackTop = NULL; copyStack(otherStack); } // end constructor
linkedStack
::~
linkedStack
() { destroyStack(); } //end destructor void
linkedStack
::copyStack(
linkedStack
& otherStack…
Reversed method won't work
Programming
Software Development
10 Years Ago
by Pyler
… } return this; } } Here's my
LinkedStack
class public class
LinkedStack
<E>{ @SuppressWarnings("hiding") … node protected Node<E> upnode; public
LinkedStack
(){ upnode=null; } //isEmpty method public boolean isEmpty…
Re: Integer Stack Copy Function
Programming
Software Development
16 Years Ago
by thekashyap
… you can implement the copy like this: [code=c] void
linkedStack
::copyStack(
linkedStack
& otherStack) { node* currNode = stackTop ; int* stack_contents = new int…
Re: Integer Stack Copy Function
Programming
Software Development
16 Years Ago
by SHWOO
… that number is being copied to the new stack. void
linkedStack
::copyStack(
linkedStack
& otherStack) { node* currNode = stackTop; int* stackContents = new int…
Reversed stack returns one item
Programming
Software Development
10 Years Ago
by Pyler
… only get one result. public
LinkedStack
<T> rev() {
LinkedStack
<T> revStack=new
LinkedStack
<T>(); final int SIZE….push(this.pop()); } return revStack;} For example
LinkedStack
<String> newLS = new
LinkedStack
<String>(); newLS.push("noid"…
linked list - converted to stack using linked list
Programming
Software Development
15 Years Ago
by tones1986
…have class/struct/union driver.cpp(32) : error C2039: '
linkedStack
' : is not a member of 'Student' student.h(10…have class/struct/union driver.cpp(56) : error C2039: '
linkedStack
' : is not a member of 'Student' student.h(10…i be doing this: Student.h - line 20: [code]
linkedStack
<CourseInfo> courseList; [/code] Changed to this: […
Linked Stack Help
Programming
Software Development
12 Years Ago
by cecsFTL
…; } public Node getPrev ( ) { return prev; } } public
LinkedStack
( ) { top = null; } public
LinkedStack
(T elem) { top = new Node (elem,null); } public… { public static void main (String [ ] a) {
LinkedStack
stack = new
LinkedStack
(); Scanner keyboard = new Scanner(System.in); //Clear stack …
Re: Reversed stack returns one item
Programming
Software Development
10 Years Ago
by Pyler
… stack leaving input stack from argument empty public void push(
LinkedStack
<T> stack){ final int SZE = s.size(); for… here's my node class (it's nested in my
LinkedStack
class) public class Node<T>{ private T data…
Re: linked list - converted to stack using linked list
Programming
Software Development
15 Years Ago
by Murtan
In the ZIP file, student.h still contains: [icode]SinglyLinkedList<CourseInfo> courseList;[/icode] so the student does NOT contain a
linkedStack
. If you want it to contain a
linkedStack
, you have to tell the compiler by changing the line.
Re: Reversed stack returns one item
Programming
Software Development
10 Years Ago
by JamesCherrill
… of the rev method above shows a return type of
LinkedStack
<T>, so there is zero possibility that it…
Re: Reversed stack returns one item
Programming
Software Development
10 Years Ago
by Pyler
I want reverse method to return a copy of the this object by referencing the reverseStack() object in the rev() method of
LinkedStack
LinkedList Implementation Help SOLVED!!!
Programming
Software Development
16 Years Ago
by mickinator
…; } } [/code] [code=java] public class
LinkedStack
{ private SLLNode top; public
LinkedStack
( ) { top = null; } public boolean empty… void main ( String [] args ) {
LinkedStack
ls = new
LinkedStack
( ); String line; try { Scanner textFile …
Re: Converting equation from infix to postfix using stack
Programming
Software Development
16 Years Ago
by Salem
…} [/code] You can then expand the tests with [code]
LinkedStack
in2post( std::string expr ); int main ( ) { std… i < sizeof expr / sizeof *expr ; i++ ) {
LinkedStack
result = in2post( expr[i] ); } } [/code] When you…] std::string myExpr; getline( cin, myExpr );
LinkedStack
result = in2post( myExpr ); [/code] As far…
reverse list in java
Programming
Software Development
10 Years Ago
by Pyler
… in stead. Any clues? public
LinkedStack
<E> reversed() {
LinkedStack
<E> revertStack = new
LinkedStack
<E>(); if(this.isEmpty…
Re: reverse list in java
Programming
Software Development
10 Years Ago
by Pyler
… stack is empty. Suppose I create a generic
LinkedStack
<String> stack1 =
LinkedStack
<String>() object and populate it with…
In desperate need of help with iterative insert method for avl tree. please help
Programming
Software Development
16 Years Ago
by Shana8426
… in this BST. { int count = 0; if (root != null) {
LinkedStack
hold = new
LinkedStack
(); BSTNode currNode; hold.push(root); while (!hold.isEmpty()) { currNode…
Converting equation from infix to postfix using stack
Programming
Software Development
16 Years Ago
by LanierWexford
… InOp2='#'; //Holds value for comparison to properly push onto stack.
LinkedStack
Cal; //stack used to hold info in postfix format void…
Node question
Programming
Software Development
13 Years Ago
by minimi
… Integer calcs(String postFix) { StackInterface<Character> stack = new
LinkedStack
<Character>(); // instantiate Character stack Integer result = new Integer…
Problem with stack::Top()
Programming
Software Development
13 Years Ago
by flowerzink
…]; }[/CODE] and also: [CODE]template<class T> T
LinkedStack
<T>::Top() const {// Return top element. if (IsEmpty…
1
2
3
Next
Search
Search
Forum Categories
Hardware/Software
Programming
Digital Media
Community Center
Latest Content
Newest Topics
Latest Topics
Latest Posts
Latest Comments
Top Tags
Topics Feed
Social
Forums
Top Members
Meet People
Community Functions
DaniWeb Premium
Newsletter Archive
Markdown Syntax
Community Rules
Developer APIs
Connect API
Forum API Docs
Tools
SEO Backlink Checker
Legal
Terms of Service
Privacy Policy
FAQ
About Us
Advertise
Contact Us
© 2024 DaniWeb® LLC