Stack & Singly Linked List Data Structures

P

Patrick McCourt

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
 
T

Tony Morris

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
 
K

Kenneth P. Turvey

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,431
Messages
2,571,678
Members
48,796
Latest member
Greg L.

Latest Threads

Top