Answered step by step
Verified Expert Solution
Question
1 Approved Answer
write the following programe using simply linked list in c++ language. 1) Insert before tail : Insert a value into a simply linked list, such
write the following programe using simply linked list in c++ language.
1) Insert before tail : Insert a value into a simply linked list, such that it's location will be before tail.
So if a list contains {1, 2, 3}, insert before tail value 9 is called, the list will become {1, 2, 9, 3}.
2) Insert before value : Insert a value into a simply linked list, such that it's location will be before a particular value.
So if a list contains {1, 2, 3}, insert before 2 value 9 is called, the list will become {1, 9, 2, 3}.
3)Count common elements : Count common values between two simply linked lists.
So if a list1 contains {1, 2, 3, 4, 5}, and list2 contains {1, 3, 4, 6}, number of common elements is 3.
4) Check if sorted : Check if elements of simply linked lists are sorted in ascending order or not.
So if a list contains {1, 3, 7, 8, 9} its sorted, but if a list contains {1, 3, 7, 2, 5} its not sorted.
5) Find sublist : Find and return sublist in a list, the start and stop positions indicate where the sublist starts and where it ends.
So if a list contains {1, 3, 7, 8, 9}, sublist at start 2 and stop 4 is {3, 7, 8} .
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started