Question: Using C programming Langauge: Write a program that, using malloc and realloc, creates an array of initial size n. Write add(), remove() and get() functions

Using C programming Langauge: Write a program that, using malloc and realloc, creates an array of initial size n. Write add(), remove() and get() functions for your array. When adding beyond the end of the array, reallocate space such that the array contains one more element. Time your program for adding 100000 elements (or more). Then modify the program such that it increases in size by a factor of 2 times the previous size. Time it again. What do you observe? Thanks in advance

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!