CPSC 2430 Assignment #2 solved

$35.00

Category: You will receive a download link of the .ZIP file upon Payment

Description

5/5 - (1 vote)

P2 exercises your understanding of:
LINKED LISTS (construction, traversal, insertion, deletion, deallocation)
dynamic memory
pointers

Submitted programs must:
1) provide the requested functionality
2) be appropriately documented (thorough but concise)
3) use C++ constructs as intended

ALL ASSUMPTIONS SHOULD BE REASONABLE AND CLEARLY STATED
DO NOT HARD CODE

FOR THIS ASSIGNMENT, DO NOT USE CLASSES

Write a C++ program that:
1) constructs an ordered linked list to store integer values
stores only transformed versions of odd prime numbers
if odd prime number ‘x’ is pushed, the (‘previous prime’ -1) is stored
5, 11, 17, 23, 29, … pushed => 2, 6, 12, 18, 22, … stored
1, 2, 4, 6, 8, 9 ,.. would not be stored
2) defines routines to:
a. traverse the linked list
b. insert an element into the linked list
c. delete an element from the linked list

3) tests the routines using a random number generator

TEST YOUR PROGRAM BEFORE SUBMISSION
Name your C++ file: P2.cpp

Submit P2.cpp to cs1 and Canvas