0
I need an algorithm that handles a linear list of type FILA. (In PASCAL, it can either be done in pseudo-code, or C, or whatever is preferable).
The algorithm must take an element from the queue, remove it and insert this element at the beginning. The array that completes the queue must be rearranged (since if you take the element out of the middle, you break the queue).
The FILA is circular, it comes back in itself, I will leave down the structure of the cell made in PASCAL:
type
ElementosF = integer; //tipo de dado que a fila ira receber
fila = record
memoria:array[1..TAMF] of ElementosF; //memoria da fila
final,inicio,total:integer; //ultimo, primeiro, total de elemento da fila
end;
The question is, how do I do that? I’ve tried it in many ways, and I’ve all failed... Thank you
Good implementation. I was not very convinced, I did some tests here and did not find bug. :)
– zentrunix