Regarding adding parent Node value

According to this what I can understand is that here we are storing the parent node value in a variable not in ArrayList