i am new to Data Structures and Algorithim and i am having some troubles getting around the whole topic of linked list and how its connected to nodes. The problem that is co
The problem that is confusing me is with pointers and what they point to?
In java reference works as pointer to an object in memory that internally can point to another one in the same way.
Let's try to understand it visually:
What happens to the pointer head when the object obj is added to an empty linked list?
In below snapshot head
is a reference that point to first object in the memory and first object contains another reference next
that points to second object and so on...
Write A Constructor to represent (i)
I think that you can do it as your homework.
Hint: (As shown in above snapshot as well)
next
of new node to next
of headhead
to new node