Searching Algorithms

Visualize how algorithms find elements in an array

Configure input and click Visualize to start

Input Data

Step 0of 0
Speed×5
SlowFast

Complexity

Best
O(1)
Average
O(n)
Worst
O(n)
Space
O(1)
Pseudocode
01for i = 0 to n:
02 if arr[i] == target: return i
03return -1