Results 1 to 2 of 2
Thread: Create linked list using loop
- 03-09-2013, 04:30 PM #1
Member
- Join Date
- Sep 2012
- Posts
- 10
- Rep Power
- 0
- 03-09-2013, 04:41 PM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,601
- Blog Entries
- 7
- Rep Power
- 17
Re: Create linked list using loop
Strictly speaking, if you know the number of nodes to insert, you don't need any loop at all, but it just looks silly if you have repeated a list.insert(aNode) statement thousand times ... a simple while loop will do:
kind regards,Java Code:while (moreToInsert()) list.insert(getNextNode());
JosWhen people rob a bank they get a penalty; when banks rob people they get a bonus.
Similar Threads
-
Linked List Class Cons, is this possible to turn into a doubly linked list?
By Googol in forum New To JavaReplies: 0Last Post: 09-25-2012, 04:07 AM -
Linked List, Array List time complexity
By Rick99771977 in forum New To JavaReplies: 4Last Post: 08-18-2011, 05:37 AM -
How to access an element of a linked list inside another linked list?
By smtwtfs in forum New To JavaReplies: 4Last Post: 02-21-2011, 09:34 AM -
Linked list inside a linked list
By viperlasson in forum New To JavaReplies: 5Last Post: 07-26-2010, 11:15 PM -
How to create an array of linked list reading data from a file
By kool001 in forum New To JavaReplies: 1Last Post: 12-03-2009, 07:03 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks