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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!