﻿ 代写算法作业 CSCI:381:01代写 Algorithms代写 – 天才代写

代写算法作业 CSCI:381:01代写 Algorithms代写

2022-09-07 09:40 星期三 所属： 作业代写 浏览：304

CSCI:381:01-Algorithms

Chapter 7: Quicksort  代写算法作业

1.Write a program to implement the algorithm QUICKSORT(A,p,r). The initial call is QUICKSORT(A,1,n).

The output of the program should look like the following.

>>> main() QUICKSORT:

Input: [13, -3, -25, 20, -12, -16, 24]

Output: [-25, -16, -12, -3, 13, 20, 24]   代写算法作业

2.Write a program to implement the algorithm RANDOMIZED_QUICKSORT(A,p,r). The initial call isRANDOMIZED_QUICKSORT(A,1,n).

The output of the program should look like the following.

>>> main() RANDOMIZED_QUICKSORT: Input: [13, -3, -25, 20, -12, -16, 24]

Output: [-25, -16, -12, -3, 13, 20, 24]

3.Exercise 7.1-1: Using Figure 7.1 as a model, illustrate the operation of QUICKSORT and PARTITION on thearray

You can write the solution for this problem by hand and submit it in class or to Blackboard.

4.Exercise2-1

You need to submit Problems 1, 2, and 3.

—————————————————————————————————————-

Guideline for Homework Submission  代写算法作业

1. Zip the files of the programs and submit the zipped file to
2. The first three lines in each file are
1. Write the name of the program on the first
2. Describe the purpose of the program on the second
3. Write the name of the programmer on the third line. Forexample,

// Filename: assignment1.py

// Purpose: This program coverts a positive integer in base 10 to a new base.

// Programmer: R2 D2