-
May 4th, 2004, 12:47 AM
#1
Stack Help Needed Quickly Please !!!!!!!
Hi guys,
Sorry to put you all on the spot like this, but does anyone know what the primitive methods in a stack (in java) are ? . oo ya and also what methods a complete stack should contain ?
Any help would be great.
Thanks
-
May 4th, 2004, 02:00 AM
#2
Member
Google usually helps
If you make a class that accepts object's as a parameter for its methods it should be able to handle all primitive types (in wrapper form).
Push (obj)
Pop (obj)
PeekTop (obj)
isEmpty (boolean)
clear (void)
size (int)
and you could use arrays or arraylists to implement those functions
hope that helped a bit
-
May 4th, 2004, 04:42 AM
#3
Hey,
Try out the java section of pscode.com... Just put "stack" (or whatever you want) into the search box at the top. PScode (Planet Source Code) has A LOT of code!! I did the search and it looks like there may be some stuff there that will help you.
Good luck
mjk
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
|