• Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting a set into a linked list  RSS feed

 
Bruce Banner
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What I'm supposed to do is make a method to insert a set of Tiles to the list, i.e., a detour(make sure that the inserted detour is compatible with the current path so that the resulting path does not have any gaps). But I'm confused on how to go about doing it. I was thinking of maybe just adding 1 to the current Node.








 
Paweł Baczyński
Bartender
Posts: 2074
44
Firefox Browser IntelliJ IDE Java Linux Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too much code for such a simple question. Look at this: SSCCE

Do you want to insert a set into the list?
Then, given set is your Set and list is your List write:
Or maybe you want to add all elements from the Set to the List? Then use:

 
Campbell Ritchie
Marshal
Posts: 56521
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read all about it! In the Java® Tutorials.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!