Board index » delphi » Urgent: HELP ME PLS

Urgent: HELP ME PLS

Hi! Firstly thanks for reading my post.

I am a newbie to pascal and would like to know something about
double-ended queue implementation by linear array.

Front ->   OOOOO  <-  Rear
                123456

1) I assume that AppendRear is normal operation but what are other
conditions to consider?

2) If procedure AppendFront is to be done, how to if an element is in
position '1'?

3) Assuming ServeFront is the same as normal queue or poping a stack,
what about Serving from the Rear? Again, what are the conditions to
apply?

Thanks in Advance

E-mail to ->   blues...@post1.com

 

Re:Urgent: HELP ME PLS


Quote
blues...@post1.com wrote:

> Hi! Firstly thanks for reading my post.

Well, it sure looks like homework, and not like a question
about Pascal.

Quote

> I am a newbie to pascal and would like to know something about
> double-ended queue implementation by linear array.

> Front ->   OOOOO  <-  Rear
>                 123456

> 1) I assume that AppendRear is normal operation but what are other
> conditions to consider?

If this were not a homework question, then you would be asking about
some specific other conditions you had encountered.

Quote

> 2) If procedure AppendFront is to be done, how to if an element is in
> position '1'?

If this were not a homework question, you wouldn't have asked it at
all.  But hint, anyway: treat the array as circular buffer.  Or
simply shift the values to the right.  More advanced solutions exist.

Quote

> 3) Assuming ServeFront is the same as normal queue or poping a stack,
> what about Serving from the Rear? Again, what are the conditions to
> apply?

I feel inclined to say Serving from the Rear is the same as a denormal
queue, namely, pushing a stack.  Obvious, isn't it?

Quote

> Thanks in Advance

> E-mail to ->   blues...@post1.com

Uh, well.  Not only want the homework done, but conveniently mailed
to you, too.

- Alf  (doing the quarterly 10-minute anti-homework-request crusade).

--
[Reply address intentionally foiled, but workable for humans.]

Other Threads