Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Pace Univ. Assignment 2: Implementing Queue-of-Integer Class, Assignments of Computer Science

The details of assignment 2 for cs122/504 computer programming ii course at pace university, spring 2006. Students are required to design and implement a queue-of-integer class named linkedlistqueue using a circularly linked list of node objects. The class should support methods like insert(int value), delete(), and isempty(). Students are expected to write the main() method to test their implementation and submit the completed source code files as an attachment to the assignment thread in blackboard.

Typology: Assignments

Pre 2010

Uploaded on 08/09/2009

koofers-user-4jf-1
koofers-user-4jf-1 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CRN: 22430/21519 Pace University Spring 2006
CS122/504 Computer Programming II
Assignment 2
Assigned on March 2, 2006
Due on March 14, 2006
1. Design and implement a queue-of-integer class named LinkedListQueue based on a circularly
linked list of Node objects defined below:
class Node {
int v;
Node next;
public Node(int v, Node next) {
this.v = v;
this.next = next;
}
}
The class should support the following methods:
a. public void insert(int value); // insert integer value to the end the queue
b. public int delete(); // delete and return the first value in the queue
c. public boolean isEmpty(); // return true iff the queue is empty
The number of integers that can be inserted into the queue should only be limited by the
capacity of your computer’s memory system.
Also write the main() method of the class to test out your LinkedListQueue class
implementation.
The assignment is also posted in forum Assignments inside Discussion Board of CS122/504
Blackboard. Submit a single zip file of all of your completed source code files as an attachment to your
reply to my assignment 2 thread.
Please add assignment name, your name, your assignment completion date, and the above assignment
problem description as comments at the beginning of your source code.
Please make sure that your program works correctly, and the source code is formatted properly with
proper column alignment and line indentation. Add necessary concise comments to your tricky points
for helping readers understand your program. There will be penalties for lacking necessary comments
or improper code alignment or indentation.

Partial preview of the text

Download Pace Univ. Assignment 2: Implementing Queue-of-Integer Class and more Assignments Computer Science in PDF only on Docsity!

CRN: 22430/21519 Pace University Spring 2006

CS122/504 Computer Programming II

Assignment 2

Assigned on March 2, 2006 Due on March 14, 2006

  1. Design and implement a queue-of-integer class named LinkedListQueue based on a circularly linked list of Node objects defined below:

class Node { int v; Node next;

public Node(int v, Node next) { this.v = v; this.next = next; } }

The class should support the following methods:

a. public void insert(int value); // insert integer value to the end the queue b. public int delete(); // delete and return the first value in the queue c. public boolean isEmpty(); // return true iff the queue is empty

The number of integers that can be inserted into the queue should only be limited by the capacity of your computer’s memory system.

Also write the main() method of the class to test out your LinkedListQueue class implementation.

The assignment is also posted in forum Assignments inside Discussion Board of CS122/ Blackboard. Submit a single zip file of all of your completed source code files as an attachment to your reply to my assignment 2 thread.

Please add assignment name, your name, your assignment completion date, and the above assignment problem description as comments at the beginning of your source code.

Please make sure that your program works correctly, and the source code is formatted properly with proper column alignment and line indentation. Add necessary concise comments to your tricky points for helping readers understand your program. There will be penalties for lacking necessary comments or improper code alignment or indentation.