Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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.
- Host: GitHub
- URL: https://github.com/desmondjs/bst_student_info
- Owner: DesmondJS
- Created: 2024-07-20T12:23:14.000Z (4 months ago)
- Default Branch: main
- Last Pushed: 2024-07-20T12:31:17.000Z (4 months ago)
- Last Synced: 2024-07-20T13:49:01.935Z (4 months ago)
- Topics: bst, cpp
- Language: C++
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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.git2. **Open the project in Visual Studio**
- Open 'project1.sln' in Visual Studio3. **Build and run the project**
- Build the solution and run the project to execute the program