Ayush7614 / Ayush7614/Daily-Coding-DS-ALGO-Practice

Trim a BST

Open
#504 0 comments 0 reactions 1 assignee Claimed by @Debashish-hub View on GitHub
LGMSOC21 🟨 Level2
Dominant language
C++
Stars
323
Forks
472
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**

Given the root of a binary search tree and the lowest and highest boundaries as low and high, trim the tree so that all its elements lies in [low, high]. Trimming the tree should not change the relative structure of the elements that will remain in the tree (i.e., any node's descendant should remain a descendant). It can be proven that there is a unique answer.
Return the root of the trimmed binary search tree. Note that the root may change depending on the given bounds.

**Describe the solution you'd like**
I will solve it in C++

### Programming language

- [ ] C
- [ ] C++
- [ ] Java
- [ ] Python

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.