Answered step by step
Verified Expert Solution
Question
1 Approved Answer
- There are two list operations: Insert and Remove - Remove operations will have two parts: Operation and Position - Insert operations will have three
There are two list operations: Insert and Remove
Remove operations will have two parts: Operation and Position
Insert operations will have three parts: Operations Position and Data
Valid positions:
"Head"
"Tail"
an integer Index
Only valid insertions to an empty Linked List will be:
Insert
Insert Head
Insert Tail
Each element will be in its own line.
Not all given integer Indexs will be valid
There will be no empty lines
There might be an empty input file, in this case, the output should be empty.
Remove all
and r before processing any input line.
Output files
The output file should display every element of your linked list.
Each element will be separated by a space note there is no extra space at the end of the
output
Examples
inputtxt
Insert Head Print
Insert Hello
Insert Tail World
anstxt
Print Hello World
inputtxt
Insert Howdy
Insert Hi
Remove Head
anstxt
inputtxt
Insert Head Hello
Insert Tail Hi
Insert Tail
Remove
anstxt
Hello Tail
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