# IN C ONLY PLZ (read the instruction carefully plz) You will implement the following functions: List...

###### Question:

IN C ONLY PLZ (read the instruction carefully plz)

You will implement the following functions:

List * initIntegerList( ) // Return empty list

int insertAtTail(int k, List*) // Insert k at tail

int getListSize(List *) // Return number of elements in list

This doesn’t seem so bad – and it isn’t. However, there is a performance requirement that must be satisfied: all of the functions must take only a constant amount of time independent of the length of the list, i.e., they must all have O(1) complexity. Does this make things much more difficult? No, you just need to define a struct (List) that contains a pointer to the head of a linked list; a pointer to the tail of the list; and an integer containing the number of items/keys in the list. (Note that nodes in the linked list will not be List structs.) The information in the List struct is what will allow all operations to be satisfied in O(1) time.

Note that the above prototypes impose restrictions on how you handle potential error conditions, e.g., if the user tries to remove the head of an empty list, so you will need to document those situations for the user. For example, the function printHead will need documentation telling the user that nothing is printed if the list is empty. The two insert functions, however, have integer return values that can be used for error codes.

#### Similar Solved Questions

##### The system is subject to a pressure of 101.175kPa on the right side. If PA=146kPa, what...
The system is subject to a pressure of 101.175kPa on the right side. If PA=146kPa, what is the length L of the manometer? (Note: the manometer is filled with both, mercury and water, and the angle is measured with respect to the vertical axis) Consider 7Hg=132.756kN/m3, SGair=2.0x10-3, PH20=997.5kg/...
##### A box with an initial speed of 5 m/s is moving up a ramp. The ramp has a kinetic friction coefficient of 7/5  and an incline of (5 pi )/12 . How far along the ramp will the box go?
A box with an initial speed of 5 m/s is moving up a ramp. The ramp has a kinetic friction coefficient of 7/5  and an incline of (5 pi )/12 . How far along the ramp will the box go?...
##### All of these problems should be done by hand. You may use a computer or calculator...
All of these problems should be done by hand. You may use a computer or calculator to find roots of polynomials with constant coefficients. All hand calculations can of course be verified with a computer. Show calculations for asymptote angles, center of mass, angles of departure, etc. for full cred...
##### Need help on this. Thanks in advance Question 7 Determine whether the set of vectors is...
need help on this. Thanks in advance Question 7 Determine whether the set of vectors is a basis for R3. s{{JAMA). Given the set of vectors decide which of the following statements is true: A: Set is linearly independent and spans R. Set is a basis for R. B: Set is linearly independent but does no...
##### Which is correct and why is it correct The profit from a put bear spread strategy...
Which is correct and why is it correct The profit from a put bear spread strategy when both options are out of the money is O-X1 + ST + P1 + X2 - ST - P2 0 -X1 + ST + P1 - P2 O X1 - ST-P1 - X2 + ST + P2 O P1 + x2 - ST-P2 o P1 – P2...
##### Which attacking species shown below would be the best choice to enforce an E2 pathway over...
Which attacking species shown below would be the best choice to enforce an E2 pathway over an Sp2 pathway for the reaction below? Attacking Species? Br H CH,MpBr HC-0 NH (a) H (b) e OH H₂C_&_• SH Els (d) (1)...
##### Material science Questions: In the given crystal structure ? (1) Write the postions for the four...
material science Questions: In the given crystal structure ? (1) Write the postions for the four dots. (II) Write the direction for the arrow....
##### 36. The transition from Phase 2 to Phase 3 of the Demographic Cycle is often referred...
36. The transition from Phase 2 to Phase 3 of the Demographic Cycle is often referred to as the Demographic Transition. a. What are the socio-economic correlates of this transition? b. What population policies does the transition suggest?...
##### Which of the following is true regarding fermentation? Group of answer choices Fermentation occurs in the...
Which of the following is true regarding fermentation? Group of answer choices Fermentation occurs in the cell membrane of organisms Yeast produces lactic acid through fermentation At the end of fermentation NADH is converted back into NAD+ The end product pyruvate proceeds into the Krebs cycle...
##### Find the principal needed now to get the given amount; that is, find the present value....
Find the principal needed now to get the given amount; that is, find the present value. To get $300 after 2 years at 7% compounded monthly The present value of$300 is \$ (Round to the nearest cent as needed)...
##### 06: The results shown in the table below were obtained from a series of consolidated- undrained...
06: The results shown in the table below were obtained from a series of consolidated- undrained triaxial tests for specimens of saturated clay. Answer TWO of the followings: (a) Compute effective principle stresses for all specimens (b) Draw (by scale) Mohr Circle for total and effective stresses fo...
##### Use electron pushing/arrow formalism that shows the formation of your proposed product in the previous problem.
Use electron pushing/arrow formalism that shows the formation of your proposed product in the previous problem....
##### What is the antiderivative of  (5x)/(x^2+1) ?
What is the antiderivative of  (5x)/(x^2+1) ?...