Write a C++ code that implements a Doubly Linked List structure that contains Integer
elements, and then do the following:
- Implement the necessary member functions (insert, display, and search).
- Implement a function “DoublyLinkedList getUnion(DoublyLinkedList L2)” that
displays the union of the calling list (L1) and L2. - Implement a sample run of the getUnion function.
Example: input L1 = 1, 2, 3, 4
L2 = 2, 5, 4, 6
output L3 = 1, 2, 3, 4, 5, 6