Module searching

← Back to All Modules





Description

Array searching module. This module provides Linear search and Binary search.


Constants

There are no constants.


Functions


Classes

There are no classes.


Example

import searching
 
data = [2, 9, 10, 23, 5, 1, 12, 8]
key = 12
 
index = search(key, data)
 
if index != -1
    writeln("Found at index " & index)
else
    writeln("Not found!")
endif