Answered step by step
Verified Expert Solution
Link Copied!

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 0
- 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.
3. 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).
4. Examples
input1.txt
Insert Head Print
Insert 2 Hello
Insert Tail World
ans1.txt
Print Hello World
input2.txt
Insert 3 Howdy
Insert 0 Hi
Remove Head
ans2.txt
input3.txt
Insert Head Hello
Insert Tail Hi
Insert 2 Tail
Remove 1
ans3.txt
Hello Tail

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

Linked Data A Geographic Perspective

Authors: Glen Hart, Catherine Dolbear

1st Edition

1000218910, 9781000218916

More Books

Students also viewed these Databases questions

Question

What is involved in the posting process?

Answered: 1 week ago

Question

a. Do team members trust each other?

Answered: 1 week ago