Skip to content

Optimize and Test Optimal Binary Search Tree Implementation for optimal_binary_search_tree.py #11724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
SamyakMishra072 opened this issue Oct 3, 2024 · 3 comments · May be fixed by #11771
Closed
Labels
enhancement This PR modified some existing files

Comments

@SamyakMishra072
Copy link

SamyakMishra072 commented Oct 3, 2024

The current implementation of the optimal binary search tree algorithm works well, but there are a few areas for improvement and further testing.

@SamyakMishra072 SamyakMishra072 added the enhancement This PR modified some existing files label Oct 3, 2024
@SamyakMishra072 SamyakMishra072 changed the title Optimize and Test Optimal Binary Search Tree Implementation Optimize and Test Optimal Binary Search Tree Implementation for optimal_binary_search_tree.py Oct 3, 2024
@tianyizheng02
Copy link
Contributor

Could you elaborate on how the implementation could be improved?

@ghost
Copy link

ghost commented Oct 4, 2024

Hi team!,

I’m interested in contributing to this issue. I believe I can help with it. Could you please assign it to me? Looking forward to collaborating!

Thank you!

@SamyakMishra072
Copy link
Author

Knuth’s optimization has been used for optimal_binary_search_tree.py here function has been ,applied with hardcoded intervals using root[i][j - 1] and root[i + 1][j]. and this is reducing the range of r, more extensive testing should be done to ensure correctness when the intervals are small or boundaries overlap. I want to fix this so that it works correctly, especially when the intervals are small or the boundaries overlap.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement This PR modified some existing files
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants
@tianyizheng02 @SamyakMishra072 and others