0% found this document useful (0 votes)
63 views

CMP2006 Mock Lab Test 1

The document provides instructions for a lab test on data structures. Students are asked to: 1. Create a project folder and project in their IDE. 2. Implement classes for a LinearList data structure including methods for insertion, retrieval, removal, display, and destruction. 3. Write a driver program to test the LinearList methods by inserting items, retrieving, removing, and destroying items and displaying the list.

Uploaded by

Amir Abbas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

CMP2006 Mock Lab Test 1

The document provides instructions for a lab test on data structures. Students are asked to: 1. Create a project folder and project in their IDE. 2. Implement classes for a LinearList data structure including methods for insertion, retrieval, removal, display, and destruction. 3. Write a driver program to test the LinearList methods by inserting items, retrieving, removing, and destroying items and displaying the list.

Uploaded by

Amir Abbas
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

Lab

Test #1 (0%)

Name: ID:
Module: Data Structures (CMP2006) Date: Today
Occurrence: BSc Duration: 1 hr. 30 mins.

Figure 1 - Classes for Implementation


1. Login using the assigned username “test____” and password “123456”.

2. Create a folder on the G:\ drive using your name JohnPublic and append your student Id number to the
name of the folder. e.g. G:\JohnPublic_1234567.

3. Using the Microsoft Visual C++ IDE or Eclipse Java IDE provided, create a new project called LabTest1,
in the folder you created in Task 2.

4. Implement the classes shown in Figure 1.

5. For each file you create, place your name, id number, and date at the top of each source file as
comments. [4 marks]

6. The following LinearList class methods must be implemented as described:

i. insert adds a new node at the front of the linear list. [7 marks]

ii. retrieve returns the data stored in the node at the front of the linear list. [7 marks]

iii. remove deletes the node at the front of the linear list. [7 marks]

iv. display displays the data information for all nodes in the linear list. [7 marks]

v. destroy deletes all nodes from the linear list. [7 marks]


1

7. Add a driver file / class with a main method to the project, in main write code to do the following:

i. create a new Linear list object with an appropriate name. [2 marks]

ii. display contents of the linear list. [1 mark]

iii. insert at least five (5) items into the linear list. [6 marks]

iv. display contents of the linear list. [1 mark]

v. retrieve and display one (1) item from the linear list. [3 marks]

vi. display contents of the linear list. [1 mark]

vii. remove and display one (1) item from the linear list. [3 marks]

viii. display contents of the linear list. [1 mark]

ix. destroy deletes all nodes from the linear list. [2 marks]

x. display contents of the linear list. [1 mark]


NB: To pass this test your program must compile and run correctly.

Total Marks - 60

You might also like