Programming Project # 2

(due Friday April 18)

Write a C function, called OInsert(L, k), which will traverse an ordered linked list, L, and insert the integer k in a cell in its proper position. L will be ordered from left to right, with the smallest integer at the left end.

This function can be used to build an ordered list, starting with L empty.

Build a list using OInsert() using the following data, and starting with the integer on the left.

Build another list using OInsert() with the following data,

Write another C function called MergeLists(L1, L2) which will take two ordered list and merge them into a single list. This function should return a pointer to the merged list. Test your function using the L1 and L2 lists described above.

Print out enough information during the operation of your functions, so that the grader can easily see that they are working correctly.