Java 双链表队列

mac2022-06-30  18

public class FirstLastListQueue { private FirstLastList fll = new FirstLastList(); public void push(Object obj){ fll.insertLast(obj); } public Object pop() throws Exception{ return fll.deleteFirst(); } public void display(){ fll.display(); } public static void main(String[] args) throws Exception{ FirstLastListQueue fllq = new FirstLastListQueue(); fllq.push(1); fllq.push(2); fllq.push(3); fllq.display(); System.out.println(fllq.pop()); fllq.display(); fllq.push(4); fllq.display(); } }

  

转载于:https://www.cnblogs.com/liyantsc/p/4729042.html

最新回复(0)