aspose file tools*
The moose likes Java in General and the fly likes  implement a list Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark " implement a list" Watch " implement a list" New topic
Author

implement a list

Isaac Ferguson
Ranch Hand

Joined: Jun 22, 2012
Posts: 357
Hi

I have the question. I am trying to discover the answer , but I have no idea.



Any ideas, please?

Regards
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3553
    
  15
Well the ArrayList class uses an array internally, so that would probably be a good approach to take.

Joanne
Mack Wilmot
Ranch Hand

Joined: Jul 27, 2011
Posts: 88

There are a couple of basic underlying structures you can use for a list, depending on how it is to be used. One is easy to access elements with an index and the other is more efficient for inserting elements into the middle of the list. The required methods in the question points toward one of these structures, do you know which one and what it is?
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 38851
    
  23
Or you can search posts from today and yesterday and see how people are implementing linked lists. You would obviously have to write your own code, only using what you find as inspiration.
Joanne Neal
Rancher

Joined: Aug 05, 2005
Posts: 3553
    
  15
Mack Wilmot wrote:One is easy to access elements with an index and the other is more efficient for inserting elements into the middle of the list.

The specification never said it had to be efficient
Mack Wilmot
Ranch Hand

Joined: Jul 27, 2011
Posts: 88

Joanne Neal wrote:
Mack Wilmot wrote:One is easy to access elements with an index and the other is more efficient for inserting elements into the middle of the list.

The specification never said it had to be efficient


It doesn't require inserting elements into the middle of the list either.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: implement a list