Skip to content

Latest commit

 

History

93 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

Flight Data Analyzer & Query Engine

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.

🚀 Key Features

  • 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.

🛠️ Execution Modes

The application compiles into three distinct executables to serve different operational needs:

  1. 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.
  2. Interactive CLI (programa-interativo): Provides a terminal-based, user-friendly menu (built with ncurses/readline) to execute queries dynamically on the loaded dataset.
  3. 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.

📊 Supported Queries

The engine supports a variety of complex statistical queries, including:

  • Q1: Detailed airport traffic summaries (arrivals/departures).
  • Q2: Top N aircraft 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 N airlines ranked by average flight delay.
  • Q6: Most common destination airports for specific passenger nationalities.

💻 Tech Stack

  • Language: C (Standard Library)
  • Libraries: glib2 (Data Structures), ncurses / readline (Interactive UI)
  • Tools: Make, GCC, Valgrind, GDB

⚙️ Build & Run

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>

🎓 Academic Context

This project was developed within the scope of the Laboratórios de Informática III course at the University of Minho. Grade: 14/20

About

A high-performance command-line application built in C to parse, manage, and query large datasets of flights, airports, and passengers. Features custom data structures for optimized execution times.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages