Hello, I need two simple linkedlist data structures implemented in C++.
Here are specifications for both. These must be implemented as classes, not structs.
1) Create a doubly connected linkedlist class. Each node should store two pointers, called next and prev.
The functions to include for this linkedlist are:
-Insertion − Adds an element at the beginning of the list.
-Deletion − Deletes an element at the beginning of the list.
-Insert Last − Adds an element at the end of the list.
-Delete Last − Deletes an element from the end of the list.
-Insert After − Adds an element after an item of the list.
-Delete − Deletes an element from the list using the key
Encapsulate the class such that a user does not have access to nodes (The nodes should not be accessible from a linkedlist object).
Create an iterator for this linkedlist (Should iterate from head to tail).
2) Create a priority_linkedlist class. Data of each node becomes priority of that node. There should be only one insert function (push) that inserts the item based on its priority. The highest priority item is the head of the list. The pop function removes the highest priority item and return its value. The top function is the same as pop but does not remove the item.
No iterator for this linkedlist.
Both linkedlist classes should include all the specifications and work correctly and safe. The classes should be separated into two different .cpp/.h files ([url removed, login to view] and [url removed, login to view]). I would like this to be completed within the next few hours if possible. Thanks