Write a program that inserts the following numbers into two (2) empty doubly linked list. L1 50 30 25 75 82 28 77 L2 50 40 25 75 80 21 37 30 Hint: Put the median at the first element of linked list for both linked list and after inserting median element at the first node, do not pass that element again. Median Formula: (n+1)/2 a) Implement an insert function for both L1 and L2. b) Implement a function to delete 80 from L2. c) Implement a function to check L1 and L2 are really the same list of nodes or not. Note: You are not allowed to use any built-in Data Structure classes to implement above scenar

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question

Write a program that inserts the following numbers into two (2) empty doubly linked list.
L1 50 30 25 75 82 28 77
L2 50 40 25 75 80 21 37 30
Hint: Put the median at the first element of linked list for both linked list and after inserting
median element at the first node, do not pass that element again. Median Formula: (n+1)/2
a) Implement an insert function for both L1 and L2.
b) Implement a function to delete 80 from L2.
c) Implement a function to check L1 and L2 are really the same list of nodes or not.
Note: You are not allowed to use any built-in Data Structure classes to implement above
scenario.

Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Linked List Representation
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning