#Can someone help me understand LinkedList Queues

1 messages · Page 1 of 1 (latest)

willow sentinelBOT
#

<@&987246399047479336> please have a look, thanks.

willow sentinelBOT
#

While you are waiting for getting help, here are some tips to improve your experience:

Code is much easier to read if posted with syntax highlighting and proper formatting.

If nobody is calling back, that usually means that your question was not well asked and hence nobody feels confident enough answering. Try to use your time to elaborate, provide details, context, more code, examples and maybe some screenshots. With enough info, someone knows the answer for sure.

Don't forget to close your thread using the command </help-thread close:1027500463647621170> when your question has been answered, thanks.

#

I uploaded your attachments as gist. That way, they are easier to read for everyone, especially mobile users 👍

bold pier
#

@rain seal wym?

rain seal
#

im having trouble with understanding the pseudocode for instance on line 194

#

i cant tell if it wants me to do it in the for loop or start on line 208

#

also on line 208, it's telling me to start a LL queue by assigning head and tail variables
so i did this:
Block head = null;
Block tail = null;
but i feel like it is wrong

bold pier
#

you prolly have to just declare head and tail nodes at first

#

since they mentioned it's not yet initialized

#

declaring something and assigning something are two things

#

Block head = null this is both done in one step

rain seal
#

i also see that is was initialized in line 20 and 21

#

but what i just did was declare?

bold pier
#

right that's just declaring stuff

#

initializing is when you give it a value

rain seal
#

you know how it says start the LL queue here

#

below block head = null;
would i do Block<Integer> temp = new LinkedList<INteger>();?

#

to start a queue

#

or is that already provided from the for loop on line 212?

bold pier
#

yea you prolly have to initialisze it at that start todo

#

and assign head and tail there

rain seal
#

would this be a approritae way in doing it?
head = tail = new Block();

bold pier
#

that's not how you do assignment in java