Skip to content

Refractor Binary Search Tree to mordern C++ using STL and OOP#3110

Closed
shreyash24-tech wants to merge 1 commit intoTheAlgorithms:masterfrom
shreyash24-tech:refractor-bst-modern
Closed

Refractor Binary Search Tree to mordern C++ using STL and OOP#3110
shreyash24-tech wants to merge 1 commit intoTheAlgorithms:masterfrom
shreyash24-tech:refractor-bst-modern

Conversation

@shreyash24-tech
Copy link
Copy Markdown

@shreyash24-tech shreyash24-tech commented Feb 24, 2026

Description of Change

Checklist

  • Added description of change
  • Added file name matches File name guidelines
  • Added tests and example, test must pass
  • Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
  • Relevant documentation/comments is changed or added
  • PR title follows semantic commit guidelines
  • Search previous suggestions before making a new one, as yours may be a duplicate.
  • I acknowledge that all my contributions will be made under the project's license.

Notes:

@shreyash24-tech
Copy link
Copy Markdown
Author

This PR refactors the existing Binary Search Tree implementation to modern C++ style as mentioned in the TODO comment in the original file. The previous version used a C-style struct design with global variables and a manual queue implementation.

In this update, I converted the implementation into a proper class-based structure, removed the global queue, and replaced it with std::queue from STL. I also corrected the deletion logic to properly handle root deletion and all BST delete cases. Additionally, I replaced NULL with nullptr, improved memory management by adding a destructor, and enhanced overall code readability and safety.

The functionality of the BST remains the same, but the structure now follows modern C++ practices.

@github-actions
Copy link
Copy Markdown
Contributor

This pull request has been automatically marked as abandoned because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale Author has not responded to the comments for over 2 weeks label Mar 27, 2026
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 3, 2026

Please ping one of the maintainers once you commit the changes requested or make improvements on the code. If this is not the case and you need some help, feel free to ask for help in our Gitter channel or our Discord server. Thank you for your contributions!

@github-actions github-actions bot closed this Apr 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale Author has not responded to the comments for over 2 weeks

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant