Link to home
Start Free TrialLog in
Avatar of stevenglass
stevenglass

asked on

queue's

i would like to know what are are the advantages and disadvantages of

Queues implemented as an array
Queues implemented with nodes and pointers


i am a newbie so please explain a bit and examples would be great!

thank you for your help!!!

steven
Avatar of m_onkey_boy
m_onkey_boy

A queue implemented with an array has a pre-defined length and this cannot be changed without allocating a whole new array and copying the contents of the original, where a queue implemented with nodes and pointers will grow/shrink as needed.

Java doesn't use the concept of a pointer, though - at least not explicitly.

If you use an array, simply use an array.  If you wnat to use the node/pointer approach use java.util.LinkedList as you underlying data structure.
ASKER CERTIFIED SOLUTION
Avatar of SreedharSanni
SreedharSanni

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial