/hw3

Primary LanguageC++

Homework 3

Due: 05-31-2023 11:59:59 PM

Topics: Quick Sort

Table of Contents

⚠️ DO NOT change files marked with

// DO NOT CHANGE THIS FILE

Homework Spec

In this homework, you will write a template function that implements Quick Sort with randomized pivot selection.

Grading

You will be graded only on the same (hidden) test cases your TAs created. The test includes correctness and performance tests. The performance tests will be graded based on the running time of your implementation.

We provided some tests cases in ./tests. Feel free to modify and add more test cases, but the ./tests in your submission will not be graded. However, you will be able to see the results for your submitted test cases on Gradescope.

Submission

Use ./generate_submission.sh and submit hw3-submission.zip on Gradescope.

Setup

Use one of the following options to set up your environment.

⚠️ If you're a student, DO NOT FORK this repository because you cannot change the visibility of a forked repo to private. If you plan to use Git for version control (which is encouraged), run rm -rf .git && git init after setting up using one of the options below and push to your private repository. Any public repository containing part of this homework solution will be reported to SJA.

Option 1: VS Code with Local Dev Container

  • If Docker is not running, start Docker.

  • Click the following button to set up the environment.

    Setup Local Dev Container

  • When asked for selecting a Kit to configure CMake, choose GCC.

Option 2: VS Code with Remote Dev

  • Connect VS Code to the remote host.

  • Install C/C++ Extension Pack on Remote Server (if not already).

  • Run the following command inside the integrated terminal.

    git clone https://github.com/ecs36c-sq2023/hw3 ecs36c-hw3

  • Run code ./ecs36c-hw3 to open the folder.

  • When prompted to configure CMake, confirm and choose GCC when prompted for kit selection.

Option 3: Terminal

  • Run the following commands

    git clone https://github.com/ecs36c-sq2023/hw3 ecs36c-hw3
    cd ./ecs36c-hw3
    mkdir build
    cd build
    cmake ..

Run/Debug

Run tests using VS Code

Run -> Start Debugging

Run tests using Terminal

cd build
make
./run_tests