This week's book giveaway is in the Clojure forum.
We're giving away four copies of Clojure in Action and have Amit Rathore and Francis Avila on-line!
See this thread for details.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

implement a list

 
Isaac Ferguson
Ranch Hand
Posts: 831
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

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



Any ideas, please?

Regards
 
Joanne Neal
Rancher
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well the ArrayList class uses an array internally, so that would probably be a good approach to take.
 
Mack Wilmot
Ranch Hand
Posts: 88
Linux Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 47288
52
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Pie
Posts: 3742
16
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 88
Linux Netbeans IDE Windows
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic