Skip to content
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

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

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

Comments

@Samyak072
Copy link

Samyak072 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.

@Samyak072 Samyak072 added the enhancement This PR modified some existing files label Oct 3, 2024
@Samyak072 Samyak072 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?

@saadsalman361
Copy link

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!

@Samyak072
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.

@ivnvxd ivnvxd linked a pull request Oct 5, 2024 that will close this issue
15 tasks
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.

4 participants
@tianyizheng02 @saadsalman361 @Samyak072 and others