Docsity

FastQueue and InClass Implementation: Completing dequeue and lessThan Methods, Assignments of Computer Science

Toggle sidebar
bg1
C Sc 227 In-Class Activity
Form teams of two, choose the scribe as the person who hasn't started MineSweeper (flip a coin on
a tie or negotiate), complete dequeue below with the precondition that the queue is not empty,
and write both names here:
1. _______________________________ 2. ______________________________________
public class FastQueue<E> implements GenericQueue<E> {
private class Node {
private E data;
private Node next;
public Node(E element) {
data = element;
next = null;
}
}
private Node front;
private Node back;
public FastQueue() {
front = back = null;
}
// Complete dequeue
// Precondition: The queue is not empty
public E dequeue()
pf3

Partial preview of the text

Download FastQueue and InClass Implementation: Completing dequeue and lessThan Methods and more Assignments Computer Science in PDF only on Docsity!

C Sc 227 In-Class Activity

Form teams of two, choose the scribe as the person who hasn't started MineSweeper (flip a coin on

a tie or negotiate), complete dequeue below with the precondition that the queue is not empty,

and write both names here:

1. _______________________________ 2. ______________________________________

public class FastQueue implements GenericQueue { private class Node { private E data; private Node next; public Node(E element) { data = element; next = null; } } private Node front; private Node back; public FastQueue() { front = back = null; } // Complete dequeue // Precondition: The queue is not empty public E dequeue()

  • See other side for question