A new switching mechanism for fixed-length data packets such as ATM cells is disclosed that uses a novel buffering element to form a single physical queue in which all the data packets or cells are organized into logical queues destined for different output ports. The buffering element is a generalized sequencer circuit which allows flexible ordering of the cells in each logical queue to achieve any appropriate scheduling algorithm. This single-queue switch implements output buffered queueing and multicasting and achieves full buffer sharing. The number of input and output ports can vary independently without affecting the switch core. The size of the buffering space can be increased simply by cascading the buffering elements. This switch can be used as queue controller in RAM-based switches in which data packets are stored in a RAM memory and a fixed-length data unit represents the packet in the queue controller.