Skip to content

eanveden/peakFinder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

peakFinder

Finds a peak value of a raw integer array

    ¯\_(ツ)_/¯      

Algorithm ologn

[a,b,c,d,e,f,g]

Definition of a peak:

c is a peak if c >= b and c >= d

a is a peak if a >= b

Algorithm

if(array[n/2] < array[n/2 + 1) then check right side for peak

else if (array [n/2] < array[n/2-1] then check left side for peak)

else return array[n/2] peak is found.

About

Just a peak finder

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages