Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

O(n ^ 2) complexity due to array_fitler #1

Copy link
Copy link
@olleharstedt

Description

@olleharstedt
Issue body actions

Won't the call to array_filter cause a close to O(n ^ 2) time complexity? In principle it should be possible to do this operation in O(n), no? Could it be done without losing generality? Maybe one would need to pass a counter $i around while looping and making recursive calls?

I'm asking because I'm facing the same problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.