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

Implement sorted array Indexer #10

Open
0xnullifier opened this issue Dec 16, 2024 · 0 comments
Open

Implement sorted array Indexer #10

0xnullifier opened this issue Dec 16, 2024 · 0 comments
Labels
enhancement New feature or request medium Oh you have some experience with programming huh! Come on solve this then

Comments

@0xnullifier
Copy link
Collaborator

The Idea of Sorted Array Indexer is to keep a simple list of Keys by Some compare function for example:

type ArrayIndex struct {
    sync.RWMutex
    keys []string
    compareFunc func compare(string keyA, string keyB) (string first, string second)
} 

You have to implement the Indexer interface for ArrayIndex . The following function:
Insert: adds a new key while maintaining sort order try doing this in O(n)
Initialize: Simple function to initalize the keys capacity
Delete: Do deletion in O(n)
Keys: Implement range queries do it in most.

@0xnullifier 0xnullifier added enhancement New feature or request medium Oh you have some experience with programming huh! Come on solve this then labels Dec 16, 2024
@0xnullifier 0xnullifier changed the title implement sorted array Indexer Implement sorted array Indexer Dec 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request medium Oh you have some experience with programming huh! Come on solve this then
Projects
None yet
Development

No branches or pull requests

1 participant