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
Get step-by-step solutions from verified subject matter experts
