Skip to content

tests in search #575

Open
Open
@vil02

Description

The search functions cannot be treated uniformly in tests. The issue arises when the input array contains duplicated entries.

Consider the example when we want to fund the index of 4 in the array [1, 2, 4, 4, 4, 6, 7, 8, 9, 10] (note that the array is sorted):

To summarize the functions like Linear or Interpolation return the smallest index of the searched element (if it exists in the array). While other functions like Binary or Jump2 return some index.

I think the above shows a need to change tests or/and the implementations of the search package (for example the Interpolation function could be simplified to find some index).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions