CZ
CalcyZone
computer-science Verified Precision Tool

Linear Search Calculator

Step-by-step Linear Search calculator checking elements sequentially in unsorted arrays.

Interactive Algorithm Visualizer

Linear Search

Enter your custom input data → Run the real algorithm engine → Observe step transitions.

⚙️ Customize Algorithm Input Data

Step 1 of 4⚡ Algorithm Running
WHAT HAPPENED?

Comparing index 0 (64) with target (22).

WHY?

Algorithm state rule requirement

WHAT CHANGED?

State pointers updated

64
[0]
25
[1]
12
[2]
22
[3]
11
[4]

Mathematical Formula

Inspect arr[0], arr[1], ..., arr[n-1] sequentially

Overview & Explanation

Linear Search checks every element of a list sequentially until a match is found or the end of the list is reached.

How It Works

  • Start at index 0.
  • Compare current element with target.
  • Return index if matched; advance index otherwise.

Practical Applications

  • Searching unsorted collections
  • Small list inspection

Linear Search Example

Search 30 in [10, 50, 30, 70]

1

Check idx 2

30 == 30

= Match found at index 2

Frequently Asked Questions

What is the time complexity of Linear Search?
Linear Search runs in O(n) worst and average case time.