You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.
The text was updated successfully, but these errors were encountered: