Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Spatial Databases With Application To GIS

Authors: Philippe Rigaux, Michel Scholl, Agnès Voisard

1st Edition

1558605886, 978-1558605886

More Books

Students also viewed these Databases questions

Question

What do Dimensions represent in OLAP Cubes?

Answered: 1 week ago