Sohaib Sabir wrote:I was thinking thiere is a builting class called ListNode
Nope.
So: do you want to
use a
LinkedList to add an item, or do you want to write your own? Because there's a BIG difference between the two, and the latter is a lot tougher than the first.
The only other thing I would suggest is that if you want to roll your own, then start out with a
single-linked list unless you've been told to do otherwise, because it's a lot easier to write.
Also: your implementation seems to be mixing up aspects of a list
Node (
previous), the
List itself (
head), and a list
Iterator (
current), so I'd get those sorted out before you go much further.
HIH
Winston