A high-performance command-line application built in C to parse, validate, and analyze massive datasets of flights, airports, passengers, and reservations.
This project emphasizes robust system architecture, memory efficiency, and algorithmic optimization, utilizing advanced data structures to handle complex queries in a fraction of a second.
- High-Performance Parsing: Custom CSV parsers capable of efficiently loading and validating hundreds of thousands of records, filtering out syntactic and logical errors.
- Advanced Data Structures: Extensively uses Hash Tables and custom structures (via
glib2) to achieve O(1) and O(log N) time complexities for critical lookups and sorting operations. - Memory Safe: Strictly audited using Valgrind, ensuring 0 bytes of memory leaks across all execution paths.
- Modular Architecture: Deeply encapsulated MVC-like design separating Data Entities, Managers, Parsers, and the Query Engine to ensure high maintainability.
The application compiles into three distinct executables to serve different operational needs:
- Batch Mode (
programa-principal): Takes a directory of datasets and a text file containing a list of queries. Processes them sequentially and outputs the results to individual files. - Interactive CLI (
programa-interativo): Provides a terminal-based, user-friendly menu (built withncurses/readline) to execute queries dynamically on the loaded dataset. - Test & Profiling Engine (
programa-testes): An automated testing suite that validates output correctness against expected results, while profiling CPU execution time and maximum RAM usage.
The engine supports a variety of complex statistical queries, including:
- Q1: Detailed airport traffic summaries (arrivals/departures).
- Q2: Top
Naircraft by number of flights, with optional manufacturer filtering. - Q3: Identification of the airport with the highest departure volume within a specific date range.
- Q4: Tracking passengers who stayed the longest in the weekly Top 10 biggest spenders.
- Q5: Top
Nairlines ranked by average flight delay. - Q6: Most common destination airports for specific passenger nationalities.
- Language: C (Standard Library)
- Libraries:
glib2(Data Structures),ncurses/readline(Interactive UI) - Tools: Make, GCC, Valgrind, GDB
Ensure you have gcc, make, and libglib2.0-dev installed.
# Compile the project
make
# Run Batch Mode
./programa-principal <path_to_dataset_folder> <path_to_input_queries.txt>
# Run Interactive Mode
./programa-interativo
# Run Test Suite
./programa-testes <path_to_dataset_folder> <path_to_input_queries.txt> <path_to_expected_results_folder>
This project was developed within the scope of the Laboratórios de Informática III course at the University of Minho. Grade: 14/20