Skip to content

Commit 4687668

Browse files
author
Christian Bender
authored
Merge pull request thuva4#475 from jhalaa/racket
Added linear search in racket
2 parents 91cd03f + d308a60 commit 4687668

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
(define (linear-search number num-list)
2+
(if (member number num-list)
3+
(get-num-index number num-list 0)
4+
-1))
5+
6+
(define (get-num-index number num-list index)
7+
(if (= number (first num-list))
8+
index
9+
(get-num-index number (rest num-list) (+ index 1))))

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ Inverse Fast Fourier Transform | | | | | :+1: | | | |
4141
Johnson algorithm | :+1: | :+1: | | | :+1: | | | |
4242
Kadane's algorithm | :+1: | :+1: | | :+1: | :+1: | :+1: | :+1: | |
4343
Knuth Morris Prath Algorithm | :+1: | :+1: | | | :+1: | | | |
44-
LinearSearch | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | :+1: | | | :+1: | | :+1: |
45-
Longest common subsequence | :+1: | :+1: | | :+1: | :+1: | | | | :+1:
46-
Longest increasing subsequence | :+1: | :+1: | | | :+1: | | | |
44+
LinearSearch | :+1: | :+1: | | :+1:| :+1: | :+1: | :+1: | | | :+1: |:+1: |
45+
Longest-Common-Subsequence | :+1: | :+1: | | :+1: | :+1: | | | | :+1:
46+
Longest-Increasing-Subsequence | :+1: | :+1: | | | :+1: | | | |
4747
LongestPath | | | | | :+1: | | | |
4848
MergeSort | :+1: | :+1: | | :+1: | :+1: | :+1: | :+1: | :+1: | | :+1:
4949
MiniMax with alpha–beta pruning | :+1: | | | | | | | |

0 commit comments

Comments
 (0)