Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 

Repository files navigation

OdderonSearch

OdderonSearch

Table of Contents

Introduction

OdderonSearch is the efficient linear search algorithm that has low-footprint implementation (efficient memory usage and small code size), no division/modulus/multiplication operators and ultra-fast speed.

Author

OdderonSearch was created by William Stafford Parsons as a product of Eightomic.

License

OdderonSearch is licensed with BSD-3-Clause.

Implementation

Each mention of OdderonSearch refers to both of the following variants individually (odderonsearch_first and odderonsearch_last) implemented in C.

odderonsearch.c

The odderonsearch_first function searches for the first occurrence (left-to-right) of needle in a haystack array of haystack_length elements.

When needle is found, 1 is returned and the index position of needle is assigned as the value pointed to by position. When needle isn't found, 0 is returned.

The integral type of each element in haystack must match the integral type of needle.

The odderonsearch_last function searches for the last occurrence (right-to-left) of needle in a haystack array of haystack_length elements.

When needle is found, 1 is returned and the index position of needle is assigned as the value pointed to by position. When needle isn't found, 0 is returned.

The integral type of each element in haystack must match the integral type of needle.