Win a copy of OCP Java SE 8 Programmer II Exam Study Guide this week in the OCP forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Inserting a set into a linked list  RSS feed

 
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.








 
Bartender
Posts: 2155
46
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:

 
Marshal
Posts: 58366
178
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Read all about it! In the Java® Tutorials.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!