nikoo28 / java-solutions

Solutions in JAVA for some coding platforms.

Home Page:https://studyalgorithms.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Odd Even Linked List

pradeepsimba opened this issue · comments

Question

your answer

I can't understand about how the head returns the value.

image

Here, odd variable's value is assigned as head. But , how the head returns the answer ?

For example :

image

I assigned the value of "a" as 3 and "b" as "a". If I change the value of b. the value of "b" only changes .

But , how you returned the head as answer ?3

could you please answer me ?

With linked lists, you refer to a memory address and you change the value at that location. This is not what happens with primitive datatypes like int, double etc.
Watch my introductory video on linked lists, to understand it better :)

https://youtu.be/lrXpTVEAXCM

I understood. thanks for reply.