The basic idea behind recursive sorting algorithms How they divide the original problem? How they combine the results. Give an example of a recursive sorting algorithm and explain how it works.
How does it sort a given array? What is the best and worst case the time complexity of QuickSort and explain why? No explanation no marks. Does the choice of the pivot matter in a QuickSort algorithm why/why not?
How it sorts a given array? What is the best and worst case the time complexity of MergeSort and explain why? No explanation no marks. In which scenario would MergeSort be a good choice of sorting algorithm and explain why
What are the differences between them? Compare the stability of QuickSort and MergeSort and discuss which one would be a better choice in a scenario where stability is important.
Explain what is the purpose of this function. What is the base case for this function? Is it tail-recursive? What is the output of this function for arr = [1, 2, 3, 4, 5, 6, 7, 8] How does the function recurse and how does the return value change in each call? Write an equivalent iterative version of this function. What is the best- and worst-case time complexity of the recursive function? Give a one-line scenario for each complexity with the variables defined.
Explain what is the purpose of this function What is the base case for this function? Is it tail-recursive? What is the output of this function for arr = [1, 2, 3, 4, 5, 6, 7, 8] How does the function recurse and how does the return value change in each call? Write an equivalent iterative version of this function. What is the best- and worst-case time complexity of the recursive function? Give a one-line scenario for each complexity with the variables defined.
Explain what is the purpose of this function What is the base case for this function? Is it tail-recursive? What is the output of this function for n = 3 How does the function recurse and how does the return value change in each call? Write an equivalent iterative version of this function. What is the best- and worst case time complexity of the recursive function? Give a one line scenario for each complexities with the variables defined.
Providing a definition of recursion in your own words; Providing an example and explaining how it works; Explaining what is the base case and recursive case of the example given.
Analyze the advantages and disadvantages of using recursion over iteration in Computer Science. Provide an example and explain the reasoning behind your answers.
No abstract.