DSA-VerseLearn by watching code run
DashboardData StructuresAlgorithmsVisualizerCORECoding PlaygroundInterview QuestionsComplexity AnalyzerLearning NotesBookmarksLearning ProgressSettings
Instrumented JavaScript implementation · lines sync with the animation

Run to execute this JavaScript code for real (output appears here).

Linear Search

searching
7
3
9
4
1
8
0
1
2
3
4
5
ComparingSwapping / movingCurrentSorted / finalFound / placed

Ready.

Checks every element from left to right until the target is found or the array ends. Works on unsorted data. Press Run (Ctrl + Enter) to animate, or Step forward (F10) to go one event at a time.

1 / 10

Execution

Step

1 / 10

Line (JavaScript)

—

FUNCTION_CALL

Variables

arr[7, 3, 9, 4, 1, 8]
target4
Call stackdepth 0

main (no active function frames)

Operation counters

No counted operations yet.

Memory (measurable)

Extra variablesi
Auxiliary spaceO(1)

Data structure state

[7, 3, 9, 4, 1, 8]