Number of elements in the list

Question 3 9 marksIn two labs , you developed a C module that implements a list collection . It used a struct and adynamically allocated array as the underlying data structure . Here is the declaration of the list’s " typetypedef structintelemsPoints to the list’s backing arrayintcapacity ; / Maximum number of elements in the listintsizeCurrent number of elements in the listintlistA function named intlist take takes two arguments a pointer to a list and an integerint * intlist take ( intlist ( $ list , int n )This function returns a pointer to a new array ( not a list ) that has room for exactly in integers . Thefunction removes the first in elements from the list , and stores them in the new arrayFor example , suppose parameter list points to a list containing 3 2 5 7 8 2 ) and parameter n equals4 . The function will return a new array containing 3 2 5 , 7) The list now contains 8 2The function must terminate ( via assert ) if it is passed a NULL pointer or if n is nonpositive or if thelist contains fewer than in elementsYour intlist take function can call functions from the C standard library ( see the crib sheet at theend of this question paper ) however , it cannot call any functions from the list module you developed inthe labs e g . intlist construct , intlist append , etcComplete the definition of int list takeint * intlist take ( intlist * * list , int n )

We help you get better grades, improve your productivity and get more fun out of college!!

How it works – it’s easy

Y

Place your Order

Submit your requirements through our small easy order form. Be sure to include and attach any relevant materials.

Make a payment

The total price of your order is based on number of pages, academic level and deadline.

i

Writing process

We assign the assignment to the most qualified tutor. When the tutor completes the assignment, it is transferred to one of our professional editors to make sure that the assignment meets all of your requirements.

Once complete, we’ll send your assignment via the email provided on the order form.

 

 

Achieve academic success with the best online tutors.