K
K
Karponter2014-08-16 13:25:26
PHP
Karponter, 2014-08-16 13:25:26

How to organize a queue with insert element function in PHP?

The essence of the question is as follows: there was a need for an abstract FIFO type with the ability to "wedge" elements into any position. Give me ideas on how to implement it in PHP without using third-party ready-made scripts and extensions. Or tell me well-written scripts from which you can take the implementation.
As for the details, the number of elements that will be stored on the stack is small, no more than a hundred, but a large number of different containers are expected to be processed.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey, 2014-08-16
@karponter

php.net/manual/en/class.splqueue.php and unnecessary bikes. As for "wedge" elements, maybe you need a priority queue? So it is:
php.net/manual/en/class.splpriorityqueue.php

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question