docs(en): enhancement the linear search (#1096)

I noticed the steps in the algorithm to be continuous which would make it inconvenient for the reader. So, I reformatted the steps to look much cleaner and readable.
pull/1105/head
Nishanth Chandra 2022-12-15 00:10:30 +05:30 committed by GitHub
parent 6620f32d9c
commit 73a79fd221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 14 additions and 7 deletions

View File

@ -11,12 +11,19 @@ Linear search is usually very **simple to implement**.
**Linear Search( Array A, Value x)**
Step 1: Set i to 1
Step 2: if i > n then go to step 7
Step 3: if A[i] = x then go to step 6
Step 4: Set i to i + 1
Step 5: Go to Step 2
Step 6: Print Element x Found at index i and go to step 8
Step 7: Print element not found
Step 8: Exit
## Pseudocode