Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/desmondjs/bst_student_info

This is a a C++ program implementing a Binary Search Tree (BST) to manage student data read from a text file. This program can insert student records based on their student ID, print the deepest node, display students in ascending or descending order, clone a subtree, print nodes at each level, and print paths in the tree.
https://github.com/desmondjs/bst_student_info

bst cpp

Last synced: 11 days ago
JSON representation

This is a a C++ program implementing a Binary Search Tree (BST) to manage student data read from a text file. This program can insert student records based on their student ID, print the deepest node, display students in ascending or descending order, clone a subtree, print nodes at each level, and print paths in the tree.

Awesome Lists containing this project

README

        

# Binary Search Tree Student Data

This repository contains a C++ program that implements a Binary Search Tree (BST) to manage student data read from a text file. The program supports various operations such as inserting student records, printing the deepest node, displaying students in different orders, cloning subtrees, printing nodes at specific levels, and printing paths in the tree.

## Features

- **Read student data from a text file**: The program reads student records from a specified text file and inserts them into the BST based on their student ID.
- **Insert records**: Inserts student records into the BST.
- **Print the deepest node**: Identifies and prints the deepest node in the BST.
- **Display students**: Displays student records on the screen or writes them to another text file in ascending or descending order.
- **Clone a subtree**: Creates a clone of a specified subtree within the BST.
- **Print level nodes**: Prints all nodes at a specific level of the BST.
- **Print paths**: Prints all paths from the root to the leaves in the BST.

## File Structure

- **app.cpp**: Contains the main logic of the program.
- **BST.cpp**: Contains the implementation of the BST and its operations.
- **BST.h**: Contains the declarations of the BST class and its member functions.
- **student.txt**: Sample text file containing student data for testing.

## Usage

1. **Clone the repository**:
```bash
git clone https://github.com/DesmondJS/BST_Student_Info.git

2. **Open the project in Visual Studio**
- Open 'project1.sln' in Visual Studio

3. **Build and run the project**
- Build the solution and run the project to execute the program