Results 1 to 3 of 3
Thread: Implementing a stack as an array
- 06-22-2011, 03:31 PM #1
Member
- Join Date
- Feb 2011
- Posts
- 78
- Rep Power
- 0
- 06-22-2011, 03:52 PM #2
Underneath a lot of collection classes there are arrays. What that means is you have to be able to resize the array ie create a larger one and copy old one,
or have some logic that will span/jump from one array to another depending on the index value. For example the first array would be for indexes 0-99, the next for indexes 100 to 599 etc. Your logic would convert an index of 102 to 2 and use the second array.
- 06-22-2011, 03:55 PM #3
I'm not 100% sure what you're trying to accomplish, but is there a reason why you can't use an ArrayList? Since the size isn't set in stone you would be able to make your needed array as big as you need.
- Use [code][/code] tags when posting code. That way people don't want to stab their eyes out when trying to help you.
- +Rep people for helpful posts.
Similar Threads
-
trouble creating stack using array
By shashankc in forum New To JavaReplies: 5Last Post: 01-20-2011, 12:49 PM -
Implementing a Stack Using two Queues
By rhm54 in forum New To JavaReplies: 3Last Post: 12-01-2010, 10:28 AM -
Need help please – implementing a stack!
By sfe23 in forum New To JavaReplies: 0Last Post: 02-24-2009, 03:19 PM -
Traversing through a stack of objects, and puttin them info in an array
By szimme101 in forum New To JavaReplies: 1Last Post: 03-25-2008, 05:06 AM -
how to convert a Java array to a java stack?
By pompeez in forum New To JavaReplies: 2Last Post: 08-13-2007, 02:41 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks