No description
Find a file
2026-01-09 01:55:35 +01:00
include updated readme, and fixed linux compilation 2026-01-09 01:54:56 +01:00
report ok 2025-11-23 20:58:43 +01:00
src updated readme, and fixed linux compilation 2026-01-09 01:54:56 +01:00
.gitignore updated readme, and fixed linux compilation 2026-01-09 01:54:56 +01:00
makefile updated readme, and fixed linux compilation 2026-01-09 01:54:56 +01:00
README.md updated readme 2026-01-09 01:55:35 +01:00

External Merge Sort (Big Buffer Strategy)

A C++20 implementation of an external sorting algorithm designed to sort files that are too large to fit into the system's RAM. This project uses a Big Buffer approach to minimize disk I/O by maximizing the use of available memory during both the initial run creation and the merging phases.

Requirements

Clang++ or G++ (Support for C++20 required) Make

Compilation

make

Usage

The binary is located in the build/ directory after compilation.

Generate Data

To generate a test file with 100,000 random records:

./build/main -g 100000 -o input.dat

Sort Data

To sort the generated file using 11 buffers of 10 records each:

./build/main -i input.dat -o output.dat -n 11 -b 10

Options

Flag Description

  • i Input file path
  • o Output file path
  • n Number of buffers (minimum 3)
  • b Size of each buffer (number of records)
  • g Generate count random records
  • e Evaluate and print the contents of a file
  • d Temporary directory for merge runs