Question
(This is all in c++) Q1. Consider an UnsortedList s1 that is based on the array structure. The list s1 contains the following integer value:
(This is all in c++)
Q1. Consider an UnsortedList s1 that is based on the array structure. The list s1 contains the following integer value: 2 6 4 8 3 5
Answer the following questions. Notice that the questions A, B, C, D, and E are not related to each other.
A) What is the length of the list?
B) What is on the list s1 after executing s1.PutItem(7)
C) What is on the list s1 after executing s1.DeleteItem(4)
D) What is on the list s1 after executing s1.DeleteItem(2)
E) What is on the list s1 after executing s1.DeleteItem(5). What is the length of the list?
Q2. Consider an Unsorted List s2 that is using a linked list structure. The list s2 contains the following character: G T B E D Z.
Answer the following questions. Notice that the questions A, B, and C are not related to each other.
A) Complete Execute the two statements:
item.Inlitialize('Z');
s2.DeleteItem(item);
- What is on the list s2?
- What is the value of location->info?
- What is the value of listData->info?
B) Complete Execute the two statements:
item.Inlitialize('G');
s2.DeleteItem(item);
- What is on the list s2?
- What is the value of listData->info?
C) Complete Execute the two statements:
item.Inlitialize('K');
s2.PutItem(item);
- What is on the list s2?
- What is the value of location->next->info?
- What is the value of location->info?
- What is the value of listData->info?
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