Stack & Singly Linked List Data Structures

Discussion in 'Java' started by Patrick McCourt, May 24, 2004.

  1. Hello Java people,
    Can you help me, I need to implement a simple Stack data structure with
    Push(), Pop(), Peek(), Display() operations. Also a Singly-Linked List.
    Can anyone offer the code for
    this. I have j2sdk1.4.2 from Sun installed on XP.
    Thanks.
    Patrick
     
    Patrick McCourt, May 24, 2004
    #1
    1. Advertising

  2. Patrick McCourt

    Tony Morris Guest

    interface Homework
    {
    String getOwnerName();
    }

    interface Stack extends Homework
    {
    void push(Object o);
    Object pop();
    Object peek();
    int size();
    }

    class StackImpl implements Stack
    {
    public String getOwnerName()
    {
    return "YOU!!!!!!!!!!";
    }

    ...
    }
    --
    Tony Morris
    (BInfTech, Cert 3 I.T.)
    Software Engineer
    (2003 VTR1000F)
    Sun Certified Programmer for the Java 2 Platform (1.4)
    Sun Certified Developer for the Java 2 Platform
     
    Tony Morris, May 24, 2004
    #2
    1. Advertising

  3. On Mon, 24 May 2004 22:25:00 +0100,
    Patrick McCourt <> wrote:
    > Hello Java people,
    > Can you help me, I need to implement a simple Stack data structure with
    > Push(), Pop(), Peek(), Display() operations. Also a Singly-Linked List.
    > Can anyone offer the code for
    > this. I have j2sdk1.4.2 from Sun installed on XP.


    You probably shouldn't be posting your homework problems here looking
    for answers. If you run into specific problems I'm sure people would
    be willing to help you.

    --
    Kenneth P. Turvey <>

    Artificial Intelligence Algorithms Wiki
    http://ai.squeakydolphin.com
     
    Kenneth P. Turvey, May 24, 2004
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. HS-MOON
    Replies:
    4
    Views:
    631
    Method Man
    Sep 24, 2004
  2. CR

    AlphaSort for singly linked list

    CR, Dec 15, 2003, in forum: C Programming
    Replies:
    1
    Views:
    532
    CBFalconer
    Dec 15, 2003
  3. RAJASEKHAR KONDABALA

    Reverse search in a singly-linked list

    RAJASEKHAR KONDABALA, Dec 24, 2003, in forum: C Programming
    Replies:
    20
    Views:
    5,885
    saadbinsaulat
    Feb 27, 2011
  4. Anando

    pruning a linear singly linked list

    Anando, Apr 23, 2006, in forum: C Programming
    Replies:
    59
    Views:
    1,308
    Richard Bos
    Apr 28, 2006
  5. Raj
    Replies:
    13
    Views:
    1,680
Loading...

Share This Page