The sort_strings utility is designed to sort strings in a file and output them to standard output
The utility supports two types of working with a file:
• Via File I/O API
• Through file mapping into memory
Also supports 5 types of sortings: bubble, merge, insertion, radix and quick
At least supports sorting in ascending(asc) and descending order(des)
The parameter for the number of rows to sort in [1:MaxNumOfLinesInFile]
To find out how many lines are in a file you can use:
- in linux:
wc -l inputfile.in - in windows:
(Get-Content C:\inputfile.in).Length
! Line output is limited to thousands of characters !
common use:
./sort_strings number_of_str's input.in option_sorting comparator
This project has the ability to automatically build and test, implemented using CMake and CTest
Manually utility based on i/o api
To build project(and configure the type of working with file), test and clean must be in the project root then :
- To create build dir use:
- if you want to configure util with Map type use:
cmake -B build -DUSE_MMAP=ONandcmake --build buildor do not specify the parameter Then you can find inbuild/executable file to use according to the usage or - Run tests with:
cmake --build build --target run_all_tests
After finishing work, to delete the build directory use:
cmake --build build --target clean-build
or rm -rf ./build