Ask your own question, for FREE!
Computer Science 10 Online
OpenStudy (anonymous):

I'm making a LinkedList class and have to make certain methods for it. I don't know quite what to do for this one by the description I'm given: "Object initTraversal() Initialize a private instance variable to point to the first Node in the list (or null if the list is empty). Return the item in the first Node (if the list is not empty) or else return null." I don't get the initialize a private instance variable to point to the first Node part. Do I make a whole new node and make it link to my "first" node? If I have to return the item in the first node, why don't I just return first.da

OpenStudy (anonymous):

What language are you working in? But you shouldn't need to create a whole new node. You'll just need to have a variable that says where the first node is (in C, it'd be a pointer, in Java a reference variable).

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Latest Questions
Arriyanalol: i need help
1 day ago 7 Replies 1 Medal
Arriyanalol: CONGRATS to me
1 day ago 8 Replies 2 Medals
Legomaster346: What colleges are good that are near Arab Alabama?
1 week ago 5 Replies 0 Medals
Arriyanalol: i need help
1 week ago 6 Replies 2 Medals
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!