1 answer

Ch 6 ex 14 lists plus, c++ plus data structures, linked list understanding Problem: Use the...

Question:

ch 6
ex 14
lists plus, c++ plus data structures, linked list understanding
Problem:
Use the linked lists contained in the array pictures in figure 6.19 (see pics) to amswer the following questions :
14. Use the linked lists contained in the array pictured in Figure 6.19 to answer the following questions: a. What elements a
please show some explanation / work so that i can grasp and retain this information
Thank you so much for your time!
Chapter 6 Lists Plus free 7 .next .info nodes loj John Mark Nell Naomi Robert Susan 9 Susanne NUL NUL listi o list 2 1 Figure
14. Use the linked lists contained in the array pictured in Figure 6.19 to answer the following questions: a. What elements are in the list pointed to by listi? b. What elements are in the list pointed to by list2? c. What array positions (indexes) are part of the free space list? d. What would the array look like after the deletion of Nell from the first list? e. What would the array look like after the insertion of Anne into the second list? Assume that before the insertion, the array is as pictured in Figure 6.19.
Chapter 6 Lists Plus free 7 .next .info nodes loj John Mark Nell Naomi Robert Susan 9 Susanne NUL NUL listi o list 2 1 Figure 6.19 An array with three lists (including the free list)

Answers

1. We have been asked about elements in list1. as in the figure, list1 contains value 0, thius means list1 starts with index [0] of nodes.

So, the first element of list1 is the element stored in .info corresponding to [0] i.e. John

.next corresponding to John contains 4, this means the next element of list is stored at index [4] i.e. Nell

.next corresponding to Nell contains 8, this means the next element of list is stored at index [8] i.e.

Susan

.next corresponding to Susan contains 9, this means the next element of list is stored at index [9] i.e. Sussane

.next corresponding to Sussane is NUL, so, list1 terminates here.

so, list1 = [John Nell Susan Sussane]

2. Similarly, we can find out elements in list2 also

the first element of list2 is the element stored in .info corresponding to [1] i.e. Mark

.next corresponding to mark contains 5, this means the next element of list is stored at index [5] i.e. Naomi

.next corresponding to Naomi contains 6, this means the next element of list is stored at index [6] i.e.

Robert

.next corresponding to Robert is NUL, so, list2 terminates here.

So, list2 = [Mark Naomi Robert]

3. free starts with 7, .next of 7 contains 2, .next of 2 contains 3 and .next of 3 is Nul

So, index 7, 2 and 3 are part of free list

4. if we delete Nell from the list1, .next of John will be replaced by .next of Nell and index of Nell will be added to free list i.e. 4 will be added to .next of index [3] and .next of index [4] will be set to NUL.

Here is final List

node .info .next
[0] John 8
[1] Mark 5
[2] 3
[3] 4
[4] NUL
[5] Naomi 6
[6] Robert NUL
[7] 2
[8] Susan 9
[9] Sussane NUL

5. When we add an element to a list, it is added at the end To add a new name, we need to take a node from free, write new value to this node and set .next of the last element of list to index of this node and further set .next of index corresponding to this node to NUL.

In our case, we take the last node of the free list i.e.

3 and do the following

write Anne to .info of index [3]

set .next of [6] to 3

set .next of index [2] to NUL

Here is the final list

node .info .next
[0] John 4
[1] Mark 5
[2] NUL
[3] Anne NUL
[4] Nell 8
[5] Naomi 6
[6] Robert 3
[7] 2
[8] Susan 9
[9] Sussane NUL
.

Similar Solved Questions

1 answer
Calculus
Please help me write down the steps guys, I have the answer below. Please!...
1 answer
Compute the return on assets (ROA) for La Verne Company using end-of-year assets in your calculation....
Compute the return on assets (ROA) for La Verne Company using end-of-year assets in your calculation. Total revenue $250,000 Total expenses $190,000 Total assets $400,000...
1 answer
A city with 6 districts has 6 robberies in a particular week. Assume the robberies are...
A city with 6 districts has 6 robberies in a particular week. Assume the robberies are located randomly, with all possibilities for which robbery occurred where equally likely What is the probability that some district had more than 1 robbery? 23....
1 answer
Part A Coulomb's Law: Two point charges q--8.50 uC are fixed 10.0 cm apart along a...
Part A Coulomb's Law: Two point charges q--8.50 uC are fixed 10.0 cm apart along a horizontal bar, as shown in the figure. Their electrical forces will be used to balance the weight of a very small sphere carrying a charge Q15.0 uC, 10.0 cm from each of them in a place where g-9.80 m/s2. What is...
1 answer
3. (5 points) Find the solution u(x, t) of the equation ut = Uzx, subject to...
3. (5 points) Find the solution u(x, t) of the equation ut = Uzx, subject to the boundary conditions u(0,t) = 1, u(2, t) = 3, and the initial condition u(x,0) = 3x + 1....
1 answer
A scientist has read that the mean birth weight, H, of bables bom at full term...
A scientist has read that the mean birth weight, H, of bables bom at full term is 7.3 pounds. The scientist, belleving that he is different from this value, plans to perform a statistical test. She selects a random sample of birth weights of babies bom at full term and finds the mean of the sample t...
1 answer
Help please! >MThe way 2-Yo D chapter 12 Course Homepage-Fall 201e x1 + 4.x: x С...
Help please! >MThe way 2-Yo D chapter 12 Course Homepage-Fall 201e x1 + 4.x: x С Not Secure erto.mteducation.cornhmtpr?,05825185608277823_1549293156310 Identify the reagents needed to carry out each transformation. HO. HOcatalys H20, HO H0, HO PBry РОС 2 3 4 5 6...
1 answer
How do you find 8% of 62?
How do you find 8% of 62?...
1 answer
Please describe and explain the self-reliance argument in favor of ethical egoism. (Provide an example).
Please describe and explain the self-reliance argument in favor of ethical egoism. (Provide an example)....
1 answer
Identify and briefly discuss the theories of Foreign Direct Investment (FDI) and indicate which theory most...
Identify and briefly discuss the theories of Foreign Direct Investment (FDI) and indicate which theory most influences FDI in the Caribbean Region....
1 answer
Q1 a) Explain what it means that the ordinary least squares regression estimator is a linear...
Q1 a) Explain what it means that the ordinary least squares regression estimator is a linear estimator, paying specific attention to how it implies independent variables interact with each other. b) Give two examples of models where the parameters of interest cannot be directly estimated using OLS r...
1 answer
If a car takes a banked curve at less than the ideal speed, friction is needed...
If a car takes a banked curve at less than the ideal speed, friction is needed to keep it from sliding toward the inside of the curve (a real problem on icy mountain roads) (a) Calculate the ideal speed to take a 115 m radius curve banked at 15°. 7.37754m/s (b) What is the minimum coefficient of...
1 answer
NEED ASAP!! HELP PLEASE!!! mental approach (total 25 p) u have a mix protein sample. You...
NEED ASAP!! HELP PLEASE!!! mental approach (total 25 p) u have a mix protein sample. You need to isolate and purify an specific protein of your interest. What you have available is only a small pure sample of the protein of interest, and animal facility. Design an experimental project to be able ...
1 answer
I need help with lab this week. I have posted theory and procedures to the lab. The questions wit...
I need help with lab this week. I have posted theory and procedures to the lab. The questions with ????????? are the ones I need help with. Please Help!! Thank you Theory Density is defined as mass per unit volume that has a metric unit of kg per cubic meter. Grams per cubic centimeter i.e. g/cm3 ac...
1 answer
What is the Phillips curve used for? ( How do you use a Phillips curve to...
What is the Phillips curve used for? ( How do you use a Phillips curve to illustrate an unexpected change in inflation? If the expected inflation rate increases by 10 percentage points, how do the short-run Phillips curve and the long-run Phillips curve converge?...
1 answer
I'm lost on part b, please show all work/steps & write clearly please thanks!
I'm lost on part b, please show all work/steps & write clearly please thanks!...
1 answer
2. [-12 Points) DETAILS LARLINALG8 7.2.005. Consider the following. -4 20 0 1 -3 A =...
2. [-12 Points) DETAILS LARLINALG8 7.2.005. Consider the following. -4 20 0 1 -3 A = 040 P= 04 0 4 0 2 1 2 2 (a) Verify that A is diagonalizable by computing p-AP. p-1AP = 11 (b) Use the result of part (a) and the theorem below to find the eigenvalues of A. Similar Matrices Have the Same Eigenvalues...
1 answer
A mass m1 = 5.00 kg is connected by a light string that passes over a...
A mass m1 = 5.00 kg is connected by a light string that passes over a pulley of mass m3 = 5.0 kg to a mass m2 = 6.00 kg sliding on a frictionless inclined surface that makes an angle of 21° with the horizontal (see figure). The coefficient of kinetic friction between the mass m1 and the horizont...