Skip to content

To Add Suffix Array Implementation #6529

@NithinU2802

Description

@NithinU2802

What would you like to Propose?

I would like to implement a Suffix Array algorithm that builds an array of indices representing all suffixes of a string in lexicographical order. This implementation uses an efficient O(N log N) approach with ranking and sorting and includes handling for edge cases.

Issue details

Example:

consider a input "banana"

All Suffixes of the String

Index Suffix
0 banana
1 anana
2 nana
3 ana
4 na
5 a

Sorted Suffixes (Lexicographically)

Sorted Index Suffix Original Index
0 a 5
1 ana 3
2 anana 1
3 banana 0
4 na 4
5 nana 2

Additional Information

Adding this implementation would provide a reference solution for string algorithms and could be used in educational or competitive programming scenarios. It complements the other string algorithms in the repository.

Reference: Wikipedia: Suffix Array

I would like to contribute this✨!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions