Create a new file named linked_list_tests.c with a corresponding header


Create a new file named linked_list_tests.c with a corresponding header file. This file should contain three functions:

  1. void linked_list_insert_sequential_start(int num_samples, int sample_size)
  2. void linked_list_insert_sequential_end(int num_samples, int sample_size)
  3. void linked_list_insert_random(int num_samples, int sample_size)

Sequential Insert

The first test should create a new sample of size sample_size. Similar to the testing functions used for arrays, you can simulate this using a void * object and allocating sample_size bytes to it. Insert the new pointer at the beginning of the linked list.

The second test will be almost identical to the first one you created, except you should add each sample to the end of the list. Since you are simulating a standard, singly-linked list, you should expect that this version will perform slower inserting at the beginning of the list.

Random Insert

The third and final test should insert the samples at a random position based on the current number of samples. Reference the random tests in array_tests.c to see how the random values are generated.

After implementing all three functions, include the header file in run_tests.c and create a function named void linked_list_tests(int num_samples, int sample_size). This function should call each individual test you created previously. Use array_tests as a reference to what this should look like.

Running the Tests

The provided Makefile will compile and run the tests automatically. If you implement the functions as requested correctly, this will also work for your new tests. Once you have implemented the new tests, run the test by calling make.

The output should clearly show which test is being performed followed by the time (in ms) that it took to execute the test. Feel free to model your benchmark function after the array tests already provided. If the tests run properly, you’re done!

Table of Contents

Calculate your order
Pages (275 words)
Standard price: $0.00

Latest Reviews

Impressed with the sample above? Wait there is more

Related Questions

After watching the Ted Talk Video – What Brands Can

After watching the Ted Talk Video – What Brands Can Learn from Online Dating (, write a one-page paper about what you learned from the

Nikola Tesla

The Innovator Paper is to be written as a narrative which each student will create based on the ideas and information gathered from doing their


In this exercise you will plan a negotiation using the Getting to Yes framework. Remember that the primary objective of this assignment is to show

Graduateship in Leadership

Our overall assessment and recommendation for certification will be based on: ·         Your reflective account and portfolio of evidence.   ·         Your Assessor’s feedback.  

Retail Theft Reports – Premium Paper Help

Premium Paper Help is a professional writing service that provides original papers. Our products include academic papers of varying complexity and other personalized services, along

New questions

Don't Let Questions or Concerns Hold You Back - Make a Free Inquiry Now!