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

i want to enhance your tribonnaci by dp code for readibility #111

Open
wasiiiii76 opened this issue Oct 18, 2024 · 1 comment
Open

i want to enhance your tribonnaci by dp code for readibility #111

wasiiiii76 opened this issue Oct 18, 2024 · 1 comment

Comments

@wasiiiii76
Copy link

these are things which i want to change
Use a Vector Instead of a Map: Since you know the indices (0 to n), using a vector can be more efficient than a map for memoization.

Add Base Cases Directly: You can handle the base cases directly in the calc function to make it cleaner.

Iterative Approach: You can implement the Tribonacci sequence iteratively, which avoids recursion overhead and is generally easier to understand.

Input Validation: Add some validation for user input to handle negative numbers or non-integer values.

@Pavishkumar1
Copy link

assign me this task

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants