Please use Python, Thanks!
Data Structure
Implement a doubly linked circular linked list of Node objectscalled CircularDoublyLinkedList. The data of each Node in the listis an integer. You will collect measurements for:
- An already sorted linked list
- An already sorted linked list in descending order
- A linked list containing random data
List Size Configurations
Generate each of the above linked lists with the followingnumber of nodes:
- 500
- 1000
- 5000
- 10000
- (more values if you wish)
Note: Make copies of the original lists (as necessary)and pass the copies to each sorting routine so each routine isoperating on the same data! This is important in order tocompare the results of the different algorithms.
Sorting Routines
Implement the following linked list sorting routines(implemented as a function or as a method of yourCircularDoublyLinkedList class):
- Selection sort
- Early exit bubble sort (stops when the list is sorted)
- Insertion sort
- Shell sort
- Merge sort
- Quick sort
Data to Collect
For each sorting routine above, create a pandas DataFrame withrows for each list size configuration and columns for each metricto collect. The metrics to collect include the algorithm’sexecution time using timeit and counts for the followingoperations:
- Number of data comparisons
- Number of loop control comparisons
- Number of assignment operations involving data
- Number of assignment operations involving loop control
- “Other” operations (operations that don’t fall into one of theabove categories)
- Total number of operations (sum of the above)
Note: Be sure to comment everything you count in your code
Please use Python, Thanks!
Expert Answer
Answer to Please use Python, Thanks! Data Structure Implement a doubly linked circular linked list of Node objects called Circular…