Reference no: EM132194512
Write a c++ code and it has to work on linux machine so no conio.h....etc
Let's design a class "linked_list" that can store a list of integers. For example: 22(head)->10->7->13->
Each node contains a numeric value and a pointer to the next node. The class should at least have the following member functions:
1. Insert an element
2. Delete an element (delete by value)
3. Search an element (search by value)
4. Print the list
Now, design another class "sort_my_list" that has a linked list member variable. Now, add a function, local_sort(), to sort the list in increasing order. You can choose to implement either one of the following three algorithms discussed in class:
Selection Sort Insertion Sort Merge Sort
Remember: you cannot copy the linked list into an array/vector while you sort it.
Create a file that contains the main function. In your main, create an object of "sort_my_list" class. Define a menu to insert items in your list, delete items from the list, and print the list. Please carefully note that, when you print the list, we expect to see a sorted list of integers.