The project is developed by students of the University of Science, VNU-HCM, as part of the course "Data Structures and Algorithms" (CQ2023/3).
23CTT3 - Group 9:
1. Nguyen Quang Duy - 23120245
2. Luu Trong Hieu - 23120258
3. Van Dinh Hieu - 23120260
Repository link: https://github.com/HieuMagic/Sorting-Project.git
Special thanks to our teacher, Mrs. Phan Thi Phuong Uyen, for her guidance and support.
- Clone the repository to your local machine.
- Navigate to the project directory.
- Compile the source code using your preferred compiler. Example with g++:
g++ sorting.cpp -o sorting.exe4.Your source code can compiled into an executable file (.exe) that can be executed using commands in the command prompt. The executable file must be placed in the same directory as the source code.
Note: There's also a file called command_test_example.txt that contains some example commands that you can use to test the program.
• Prototype: [Execution file] -a [Algorithm] [Input filename]|[Output parameter(s)]
– Example: sorting.exe -a radix-sort 70000_random_input.txt -both
Command 2: Run a sorting algorithm on the data generated automatically with specified size and order.
• Prototype: [Execution file] -a [Algorithm] [Input size] [Input order] [Output parameter(s)]
– Example: sorting.exe -a selection-sort 50000 -rand -time
• Prototype: [Execution file] -a [Algorithm] [Input size] [Output parameter(s)]
– Example: sorting.exe -a counting-sort 70000 -comp
• Prototype: [Execution file] -c [Algorithm 1] [Algorithm 2] [Input filename]
– Example: sorting.exe -c heap-sort merge-sort 70000_random_input.txt
Command 5: Run two sorting algorithms on the data generated automatically with specified size and order.
• Prototype: [Execution file] -c [Algorithm 1] [Algorithm 2] [Input size] [Input order]
- Example: sorting.exe -c insertion-sort selection-sort 100000 -nsorted
• -a: Algorithm mode
• -c: Comparison mode
b. Algorithm name: Lowercase, words are connected by "-" (Ex: selection-sort, binary- insertion-sort, ...)
• selection-sort
• bubble-sort
• insertion-sort
• binary-insertion-sort
• merge-sort
• quick-sort
• heap-sort
• radix-sort
• shell-sort
• counting-sort
• shaker-sort
• flash-sort
• -rand: randomized data
• -nsorted: nearly sorted data
• -sorted: sorted data
• -rev: reverse sorted data
• 1st line: an integer n, indicating the number of elements in the input data
• 2nd line: n integers, separated by a single space
• -time: algorithms’s running time
• -comp: number of comparisions
• -both: both above options
Copyright © 2024 HieuMagic.
This project is GPL-3.0 licensed.