https://github.com/wwi2196/find-the-pair
This project implements a program to find all pairs of values from a given Binary Search Tree (BST) where the sum is equal to a specified value.
https://github.com/wwi2196/find-the-pair
Last synced: 3 months ago
JSON representation
This project implements a program to find all pairs of values from a given Binary Search Tree (BST) where the sum is equal to a specified value.
- Host: GitHub
- URL: https://github.com/wwi2196/find-the-pair
- Owner: WWI2196
- License: apache-2.0
- Created: 2024-07-21T05:42:19.000Z (11 months ago)
- Default Branch: master
- Last Pushed: 2024-07-22T18:11:34.000Z (11 months ago)
- Last Synced: 2025-01-29T22:45:05.565Z (5 months ago)
- Language: C++
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Find the Pair in a Binary Search Tree (BST)
This program finds all pairs of values in a Binary Search Tree (BST) where the sum of each pair equals a specified value. It constructs the BST from user-provided input, then identifies and prints all such pairs.## Overview
The program constructs a BST from user input and then finds and prints all pairs of values within the BST that add up to a given target sum.### Example Output
Enter the number of nodes in the BST: 10
Enter the data: 5 4 6 3 7 9 10 8 2 1
Enter a value: 8
Pairs: (5, 3) (6, 2) (7, 1)