321-HW1 - { object Integer x; q1.Dequeue(x); q.Enqueue(x);...

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

View Full Document Right Arrow Icon
1. q1.Clear(); q2.Clear(); while(q.Length() > 0) { object Integer x; if (q[current] < p or q[current] == p) { q.Dequeue(x); q1.Enqueue(x); } else { q.Dequeue(x); q2.Enqueue(x); } } 2. q.Clear(); while(q1.Length() > 0)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: { object Integer x; q1.Dequeue(x); q.Enqueue(x); } q.Enqueue(p); while(q2.Length() > 0) { object Integer x; q2.Dequeue(x); q.Enqueue(x); }...
View Full Document

This note was uploaded on 02/27/2012 for the course CSE 321 taught by Professor Bucci during the Winter '11 term at Ohio State.

Ask a homework question - tutors are online