Java Generic Linked Queue Implementation (FIFO)
Classified in Spanish
Written on in
English with a size of 8.2 KB
Java LinkedQueue Implementation (Generic)
This document presents the source code for a generic LinkedQueue class in Java. This implementation uses a singly linked list structure, adheres to the FIFO (First-In, First-Out) principle, and implements the Iterable interface.
package org.mp.repaso;
import java.util.Iterator;
import java.util.NoSuchElementException;
public class LinkedQueue<T> implements Iterable<T> {
<span style="color:#ba2da2">private int</span> N; <span style="color:rgb(0,132,0)">// Tamaño de la cola</span>
<span style="color:rgb(186,45,162)">private</span> Node<T> primero; <span style="color:rgb(0,132,0)">// Primer elemento de la cola (Head)</span>
<span... Continue reading "Java Generic Linked Queue Implementation (FIFO)" »