Skip to content

Commit d3b4cb2

Browse files
committed
Linear search algorithm doc updated
1 parent 953edbf commit d3b4cb2

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

Searching/Linear Search/README.md

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,11 @@
55
![Linear Search](linear_search.gif)
66

77

8-
#### Python Implementation
8+
#### JavaScript Implementation
99

10-
Though it is very easy in python to check for [an item's existence in a list](http://stackoverflow.com/a/7571665/4230330) by:
10+
Though it is very easy in JavaScript to find index of an item in a list using [indexOf method](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/indexOf?v=example):
1111

12-
`item in list`
13-
14-
and [finding an item's index](http://stackoverflow.com/a/176921/4230330) by:
15-
16-
`list.index(item)`
12+
`list.indexOf(item)`
1713

1814
but sometimes you might need to do some customization on the searching algorithm. Like- *'finding the last occurrence of the item in the list'* etc. This linear search implementation will help you to do that.
1915

0 commit comments

Comments
 (0)