Skip to content

Conversation

@Sphinxcastor
Copy link
Contributor

This pull request adds a new implementation of the Finite Automaton pattern searching algorithm in Python. The code provides both a basic and an optimized approach to construct the automaton for efficient pattern matching, along with example usages demonstrating its functionality.

Algorithm implementation:

  • Introduced a FiniteAutomaton class in finite_automaton_pattern_search.py, which builds a deterministic finite automaton (DFA) for a given pattern and supports searching for all pattern occurrences in a text.
  • Added an optimized transition function builder build_optimized_transition_function for improved performance, especially with large alphabets.
  • Provided a convenience function finite_automaton_search that combines pattern and text alphabets, builds the automaton, and returns all match positions.

Documentation and examples:

  • Included comprehensive docstrings and comments explaining the algorithm, its time complexity, and usage details.
  • Added a main block with multiple example cases (including DNA matching and cases with no match) to demonstrate the algorithm’s usage and output.

@github-actions
Copy link

github-actions bot commented Oct 2, 2025

🎉 Welcome to Hacktoberfest 2025, @Sphinxcastor! 🎃

Thank you for your first contribution to our DSA repository! Here's what happens next:

🔍 Automatic Checks

  • Code Validation: Passed
  • 🧪 Compilation Tests: Passed

📋 Next Steps

🎯 Great job! Your code compiled successfully. Maintainers @Karanjot786 and @Pradeepsingh61 will review your PR soon.

🎁 What You Get

  • 🏆 Hacktoberfest Credit: This PR counts toward your 6 PR goal for exclusive T-shirt + Tree!
  • 🌟 Hall of Fame: You'll be featured in our contributors list
  • 📚 Learning: Code review feedback from experienced developers

💡 Tips for Success

  • Follow our Contributing Guidelines
  • Add comments explaining your algorithm
  • Include time/space complexity analysis
  • Test your code before submitting

Welcome to the community! 🚀

@github-actions
Copy link

github-actions bot commented Oct 2, 2025

🤖 Automated PR Status

🔍 Code Validation

Passed - File naming and structure look good!

🧪 Compilation Tests

Passed - All code compiles successfully!

📋 Overall Status

🎉 Ready for Review - Your PR has passed all automated checks!
👥 Maintainers have been notified for review.


This comment was generated automatically. Checks will re-run when you push new commits.

@github-actions github-actions bot requested a review from Karanjot786 October 2, 2025 18:43
Copy link
Collaborator

@Karanjot786 Karanjot786 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is good to go @Pradeepsingh61 merge it and @Sphinxcastor thanks for this PR

@github-actions github-actions bot requested a review from Karanjot786 October 3, 2025 03:44
@Pradeepsingh61 Pradeepsingh61 merged commit e57f8ae into Pradeepsingh61:main Oct 3, 2025
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants