Objective: Bubble sort! We all know when it comes to sorting algorithms; bubble sort is one of the last one's you should use. In this project you will design a C program that will create a child process that will run bubble sort on an array. More details below!

Requirements:

  • Ask the user to provide the size of an array.
  • Once the size of the array is given, use malloc to allocate the memory space for the array.
  • Ask the user for values to be stored into the array then store them in the array you created
  • Utilize the fork() system call to create a child process
  • Have the child process perform bubble sort on the array (from smallest to largest)
  • Have the child print the sorted array to screen
  • Have the parent process wait until the child has finished executing with the wait() system call
  • Have the parent process do bubble sort on the array (from largest to smallest)
  • Have the parent process print the sorted array to screen.

EXAMPLE EXECUTION:

Notice the inputs see image.

Academic Honesty!
It is not our intention to break the school's academic policy. Posted solutions are meant to be used as a reference and should not be submitted as is. We are not held liable for any misuse of the solutions. Please see the frequently asked questions page for further questions and inquiries.
Kindly complete the form. Please provide a valid email address and we will get back to you within 24 hours. Payment is through PayPal, Buy me a Coffee or Cryptocurrency. We are a nonprofit organization however we need funds to keep this organization operating and to be able to complete our research and development projects.