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

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.

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)