|
Queues
Jan 16, 2002 23:14:51 GMT -5
Post by Sylph on Jan 16, 2002 23:14:51 GMT -5
what is the tail of a queue? does it contain an element, or is it the index after the last element? on pg 29 of the lecture slides, the tail is depicted as containing no element.. is there any formal definition anywhere?
|
|
|
Queues
Jan 16, 2002 23:37:44 GMT -5
Post by 1.8T on Jan 16, 2002 23:37:44 GMT -5
isn't it last element?? page 19 in lecture slides
|
|
|
Queues
Jan 17, 2002 15:28:58 GMT -5
Post by Sylph on Jan 17, 2002 15:28:58 GMT -5
then what's w/ the picture on pg 29?
|
|
|
Queues
Jan 17, 2002 19:05:18 GMT -5
Post by 1.8T on Jan 17, 2002 19:05:18 GMT -5
then what's w/ the picture on pg 29? hmmmm., from what i can make out of those comments on page 30 tail is tail -1 + capacity for circular queue???., i;m not so sure cuz i didn't really read through my notes but circular queue have empty spaces right? like spaces with no elements in them.,,. so i guess everything from tail and on till the end of capacity is empty.,,. so if i'm getting this right can anyone tell me? cuz i'm confused,.., i really dind't know what i just said.,., sorry if i made it more confusing.,.,
|
|
|
Queues
Jan 17, 2002 20:12:58 GMT -5
Post by Tiffany on Jan 17, 2002 20:12:58 GMT -5
Hmmm, from what I understaded is that you can set the tail either to the index of the last element of the queue or to that index-1.... I am not so sure.........btw, for the second question, does that mean to remove all the elements in the queue and make the size = 0?
|
|
|
Queues
Jan 17, 2002 22:27:30 GMT -5
Post by Majin_Blues on Jan 17, 2002 22:27:30 GMT -5
got a stupid and yet arbitrary question about the definition of a "bug"...
by "bug", do they mean that the calculations will be wrong but it will still run, or it just won't compile altogether?
|
|
|
Queues
Jan 17, 2002 22:31:05 GMT -5
Post by Majin_Blues on Jan 17, 2002 22:31:05 GMT -5
btw, for the second question, does that mean to remove all the elements in the queue and make the size = 0? I'm pretty sure it won't do that... if you look at the method, it doesn't affect "contents" directly... but by bug, do they mean it won't compile or it just won't have the right calculations (but still run)?
|
|
|
Queues
Jan 18, 2002 18:06:50 GMT -5
Post by Sylph on Jan 18, 2002 18:06:50 GMT -5
but by bug, do they mean it won't compile or it just won't have the right calculations (but still run)? i think both are bugs. but u get marks for handing in something that just compiles, anyway, right? so maybe even a class w/ nothing in it would earn u part marks.. i guess they expect u to be smart enough to hand in something that compiles, rather than code that is right in the most part, but doesn't compile.
|
|
|
Queues
Jan 23, 2002 20:46:21 GMT -5
Post by kermit on Jan 23, 2002 20:46:21 GMT -5
what is the tail of a queue? does it contain an element, or is it the index after the last element? on pg 29 of the lecture slides, the tail is depicted as containing no element.. is there any formal definition anywhere? from the lecture slides in the 148 handbook, the tail should be one past the last element of the queue. like where the next element would go if u were to add one to the end of the queue. i think java likes that kind of thing...going one past the end, cuz just like how when u take substring(start, end), the end number is one past the last letter that u want.
|
|