Skip to content

[OTHER] Linear search not returning index #1544

@Lk-ux

Description

@Lk-ux

What would you like to share?

Hi, I'm new to this repo. So please enlighten me if that's just the way things are done here.
In the linear search file, I noticed that it returns 1 when an element is found and 0 otherwise.
Not a fatal error per se, but isn't a searching algorithm supposed to return the position/index at which the required value was found, like done in other files? Why make a difference for a trivial linear search?

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions