Skip to content

Raghava716/Train_Management

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

πŸš† Train Route Management System (Doubly Linked List in Python)

This project demonstrates the use of a Doubly Linked List (DLL) data structure to simulate a Train Route Management System.
It allows users to insert, delete, search, and navigate between railway stations interactively.


πŸ“˜ Project Description

The Train Route Management System is implemented using Python classes to model a doubly linked list where:

  • Each node represents a train station.
  • Stations are linked in both forward and backward directions, allowing traversal from one station to the next or previous station easily.

This project helps understand:

  • How Doubly Linked Lists work internally.
  • How to manage dynamic data insertion, deletion, and navigation in real time.
  • The concept of data abstraction and object-oriented programming in Python.

🧠 Key Features

βœ… View the entire train route
βœ… Insert a new station (anywhere in the route)
βœ… Delete a station
βœ… Search for a station by name
βœ… Display the next or previous station
βœ… Fully menu-driven console interface


🧩 Data Structure Used

The program uses a Doubly Linked List, which consists of:

  • Node class – representing each station (with prev, next, and station_name attributes)
  • DoublyLinkedList class – providing all route operations

Each station is connected in both directions, making traversal easy in either direction.


βš™οΈ How It Works

  1. The system starts with a few default stations (A, B, C, D).
  2. A menu-driven interface allows users to:
    • Insert a new station after any existing station.
    • Delete any station by name.
    • Search for a specific station.
    • View next and previous stations.
  3. The program continues running until the user chooses to exit.

πŸ§‘β€πŸ’» Code Overview

Main Classes

  • Node: Represents each station in the route.
  • DoublyLinkedList: Manages route operations (insert, delete, search, display, etc.).

Main Function

The main() function provides an interactive CLI menu for user input and control flow.


πŸš€ How to Run

Option 1: In Jupyter Notebook

  1. Open the .ipynb file in Google Colab or Jupyter Notebook.
  2. Run all cells sequentially.
  3. Interact using the console prompts.

Option 2: As a Python Script

  1. Save the notebook as a Python file (.py):

About

Python-based Train Route Management System using Doubly Linked List. Perform operations like insert, delete, search, and navigate between train stations with an interactive console interface. Ideal for learning linked list concepts in data structures.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors