ScholarMatic | 24/7 Homework Help

ScholarMatic Will Help You Write Your Essays and Term Papers

Answered » You can buy a ready-made answer or pick a professional tutor to order an original one.

implement a linked list class using pointers and object-oriented programming.

by | Nov 28, 2023 | engineering

implement a linked list class using pointers and object-oriented programming. Although the C++ STL (Standard Template Library) offers a linked list implementation, you must implement this program “from scratch” and cannot simply utilize the existing STL offerings (<list> or <forward_list>).

Your linked list will be designed to contain signed integers of type int.

Required Classes

Must implement the classes shown below (as well as the member functions that are listed).

{: val; Linked_List_Node *next; }

Note: Linked_List_Node is being used akin to a struct (with public member variables). This is intentional so that you can easily modify the member variables from within the Linked_List class.

Linked_List {: length; Linked_List_Node *first; : ; ; ; ); ); val, index); ; ; }

Note that the sort_ascending() function must be implemented using the recursive Merge Sort algorithm

 (Links to an external site.)

Links to an external site.

. sort_descending() can utilize Merge Sort or a different algorithm (see extra credit).

You are also required to implement a function that counts the number of prime numbers within a Linked_List. This can be written as part of the Linked_List class or in some other class. For our purposes, a negative number is never considered to be prime.

Application Description

Once you have implemented the fundamental building blocks of a linked list you will use this functionality to build a simple application. Implement a program to replicate the following behavior:

Please enter a number: 146 you want another (y n): yEnter a : you want another (y n): yEnter a : you want another (y n): yEnter a : you want another (y n): yEnter a : you want another (y n): n ascending descending (a d)? aYour linked : You have prime (s) your list. you want this again (y n)? nOther Program Requirements

  • When sorting nodes, you may not swap the values between nodes and must change the pointers on the nodes to swap them.
  • You must have a class for each of the following things: Linked_List, Linked_List_Node. As usual, it is completely fine to implement additional classes if you can defend their existence.
  • Your program must be factored into interface, implementation, and application. Specifically, you should have one header file and one implementation file for each class, and you should have a single application file containing your main() function. If you choose to implement a template class, it is acceptable to insert both the header and implementation information into a corresponding .hpp file.
  • You must provide a working Makefile in the TAR archive.
  • The Big 3 must be implemented as appropriate.
  • Your program may not have any memory leaks. I strongly recommend that you use Valgrind to occasionally test your program as you develop it (even when everything seems to be working).
  • Segmentation faults/core dumps are not allowed (e.g. your program crashes).
  • If your implementation does not follow the spirit of the assignment you will lose 50 points! You must implement a linked list for the storage of the data.
ScholarMatic: Explanation & Answer

Your ready answer from a verified tutor is just a click away for as little as $14.99


  

Click Order Now to get 100% Original Answer Customized to your instructions!

HOME TO CERTIFIED WRITERS

Why Place An Order With Us?

  • Certified Editors
  • 24/7 Customer Support
  • Profesional Research
  • Easy to Use System Interface
  • Student Friendly Pricing

Have a similar question?

PLAGIRAISM FREE PAPERS

All papers we provide are well-researched, properly formatted and cited.

TOP QUALITY

All papers we provide are well-researched, properly formatted and cited.

HIGHLY SECURED

All papers we provide are well-researched, properly formatted and cited.

ScholarMatic: Get Started

Assignment Writing Service

Feel safe and secure when placing an order on our portal!
Fruitful cooperation begins with solid guarantees, and we are professional enough to promise perfect results. Let’s get it started!