id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

simona1@sfusd.edu searching > linearSearchList
prev  |  next  |  chance

Searches for a target value in an ArrayList. Returns the index of the first target value in an ArrayList .Returns -1 if the target value is not in the ArrayList. The ArrayList will have a size >= 1.


linearSearchList([8, 3, -1, 7], 7) → 3
linearSearchList([1, -1, -5, 7], 1) → 0
linearSearchList([1, 1, 5, -7], 1) → 0

...Save, Compile, Run (ctrl-enter)

public int linearSearchList(ArrayList <Integer> list, int target){ }

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Java Help

Misc Code Practice

Difficulty: 313

Copyright Nick Parlante 2017 - privacy