CC-Sort is a custom command-line sorting utility developed as part of a coding challenge found here: https://codingchallenges.fyi/challenges/challenge-sort. It supports multiple sorting algorithms including Radix, Merge, Quick, Heap, and Random. This utility allows users to sort the contents of a file with options to treat lines as unique, thereby eliminating duplicates, or to include all lines.
- Support for Multiple Sorting Algorithms: Choose from Radix, Merge, Quick, Heap, and Random sorting methods to tailor the sorting process to your needs.
- Unique Sorting Capability: Optionally eliminate duplicate lines from the output, allowing for unique-only content sorting.
- Command-line Interface (CLI): Easy-to-use CLI powered by Cobra, providing clear options and commands.
- Efficient Performance: Optimized to handle large files and complex sorting operations efficiently.
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.
- You need to have Go installed on your machine (Go 1.15 or later is recommended).
- You can download and install Go from https://golang.org/dl/.
Clone the repository to your local machine:
git clone https://github.com/nullsploit01/cc-sort.git
cd cc-sort
Compile the project using:
go build -o ccsort
Run tests to ensure the application is working correctly:
go test ./...
To use the utility, execute the compiled binary with the desired options:
./ccsort --algorithm radix --unique path/to/file.txt
./ccsort -u --algorithm quick path/to/file.txt
Sort a file using the Quick sort algorithm without removing duplicates:
./ccsort --algorithm quick path/to/file.txt
Sort a file using the Random sort algorithm and eliminate duplicate lines:
./ccsort --unique --algorithm random path/to/file.txt
Sort a file using the Random sort algorithm and eliminate duplicate lines:
./ccsort -u --algorithm random path/to/file.txt