Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

#include CList.cpp // printMenu displays a menu of choices and returns the user's choice int printMenu(); // InsertList inserts an item into the list parameter

image text in transcribed

#include "CList.cpp"

// printMenu displays a menu of choices and returns the user's choice int printMenu();

// InsertList inserts an item into the list parameter

void insertListItem ( CList & );

// deleteList deletes an item from the list parameter

void deleteListItem ( CList & );

// searchItem searches for an item in the list parameter

void searchListItem ( CList );

//************************** main program ************************/

int main() { CList l; int choice; cout

choice = printMenu();

while ( choice != 6 ) {

switch ( choice ) { case 1 : insertListItem( l ); break; case 2 : deleteListItem ( l ); break;

case 3 : l.printList(); break; case 4 : searchListItem ( l ); break; case 5 : cout

default :cout

choice = printMenu(); }

CList l2;

l2 = l;

cout

//********************functions implementation ********************//

int printMenu () { int c;

cout>c;

return c; }

void insertListItem ( CList &l ) { int num; cout>num; l.insertItem(num); cout

void deleteListItem ( CList &l ) {

int num;

cout>num; if ( l.searchItem (num)) { l.deleteItem (num); cout

void searchListItem ( CList l ) {

int num;

cout>num; if ( l.searchItem (num)) cout CIRCULAR SORTED LINKED LIST CLASS Design and implement a class representing a circular sorted linked list. The class, called CList, must have the following requirements: 1. The linked list and the nodes must be implemented as CH templates 2. The class has only one private data member: a pointer to the last node. 3. It must include a constructor, a destructor, a copy constructor and an operator= 4. It must include functions to destroy a list, copy a list, insert a given item in the list, delete a given item from the list, search for a given item in the list, check if the list is empty, return the length of the list and print the list in ascending order. Use the menu-driven program provided to test your class. CIRCULAR SORTED LINKED LIST CLASS Design and implement a class representing a circular sorted linked list. The class, called CList, must have the following requirements: 1. The linked list and the nodes must be implemented as CH templates 2. The class has only one private data member: a pointer to the last node. 3. It must include a constructor, a destructor, a copy constructor and an operator= 4. It must include functions to destroy a list, copy a list, insert a given item in the list, delete a given item from the list, search for a given item in the list, check if the list is empty, return the length of the list and print the list in ascending order. Use the menu-driven program provided to test your class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions