**Sorting** algorithms often require **swapping** or switching\nvalues as part of the process of ordering values. Complete the following\ncode that implements a `swap` function for two `ints`:

\nvoid swap(int *a, int *b) {\n int tmp = ____;\n ____ = ____;\n ____ = tmp;\n}\n\n" }, "q2": { "type": "order", "question": "\n

Given the following **traces** of arrays being sorted, identify the\nalgorithm used for each **trace** (the array is printed after each\niteration through the array):

\nTrace 1:\n\n 5 7 4 0 1\n 5 7 4 0 1\n 4 5 7 0 1\n 0 4 5 7 1\n 0 1 4 5 7\n\nTrace 2:\n\n 5 7 4 0 1\n 0 7 4 5 1\n 0 1 4 5 7\n 0 1 4 5 7\n 0 1 4 5 7\n\nTrace 3:\n\n 5 7 4 0 1\n 5 4 0 1 7\n 4 0 1 5 7\n 0 1 4 5 7\n 0 1 4 5 7\n\n\n", "responses": { "bubble_sort": "Bubble Sort", "insertion_sort": "Insertion Sort", "selection_sort": "Selection Sort" } }, "q3": { "type": "multiple", "question": "\n

Which of the following statements regarding the **stability** of\n**sorting algorithms** are true (select all that apply)?

Which of the following statements regarding the use of\n**divide-and-conquer** in **sorting algorithms** are true (select all\nthat apply)?

Which of the following statements regarding the **average time complexities**\nof **sorting algorithms** are true (select all that apply)?

Which of the following statements regarding the **average space complexities**\nof **sorting algorithms** are true (select all that apply)?