FiboQueue - try{ ObjectOutputStream objstream = new...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
import*; i public class FiboQueue{ public static void main(String[] args){ int a=1,b=1; ArrayQueue aq=new ArrayQueue(10); aq.enqueue(a); for(int i=0;i<9;i++){ aq.enqueue(b); b=a+b; a=b-a; } System.out.println(aq); S
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: try{ ObjectOutputStream objstream = new ObjectOutputStream(new FileOutputStream(&quot;Fibonacci10.ser&quot;)); objstream.writeObject(aq); objstream.close(); } catch(Exception e){e.printStackTrace();} } } }...
View Full Document

Ask a homework question - tutors are online