Skip to content

TechXplorerFR/cpp-trees-management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Train Management System

The Train Management System is a C++ program designed to manage and organize train information. It allows users to efficiently perform operations such as adding, retrieving, updating, and removing train data while maintaining structured storage using binary search trees (BST).

Features

  1. Add Train
    Add a new train to the list with its travel ID, engine number, capacity, and other details.

  2. Generate Random Train
    Automatically generate a train with random attributes for testing purposes.

  3. Retrieve Train by ID
    Search for a train by its travel ID and display its details.

  4. Retrieve Train by Engine Number
    Search for a train by its engine number and display its details.

  5. Remove Train
    Remove a train from the list using its travel ID.

  6. Display All Trains
    View all trains currently in the system.

  7. Dynamic Balancing of Binary Search Trees
    Ensures efficient searching by keeping the binary search trees balanced.

How to Build and Run

Prerequisites

  1. Install a C++ compiler such as g++ with support for C++11 or higher.
  2. Use any operating system that supports C++ development (e.g., Linux, macOS, Windows).

Build Instructions

  1. Clone the repository:

    git clone https://github.com/TechXplorerFR/cpp-data-structure.git
    cd cpp-data-structure
  2. Compile the program:

    g++ -o main main.cpp train.cpp binary_tree.cpp menu.cpp -std=c++11
  3. Run the program:

    ./main

Known Limitations

  1. No Data Persistence
    Train data is only stored in memory and will be lost once the program terminates. Adding file storage or database integration would address this limitation.

  2. Fixed Stations
    Stations are predefined and cannot be dynamically input when adding a new train.

  3. Input Validation
    There is no robust error handling for invalid inputs, such as entering letters when numeric values are expected.

  4. Duplicate Travel IDs
    The program does not check for duplicate travel IDs during addition, which may result in inconsistencies.

Future Enhancements

  1. Persistent Data Storage
    Integrate file-based or database storage to maintain train data between program executions.

  2. Dynamic Station Input
    Allow users to input custom stations for each train.

  3. Improved Input Validation
    Add error-handling mechanisms to ensure robust input validation.

  4. Optimized Sorting Logic
    Enhance the sorting logic to improve performance when dealing with large datasets.

  5. Extended Features

    • Add sorting by other criteria, such as engine number or capacity.
    • Provide options to export train data to a file.

License

This project is licensed under the MIT License.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages