From 73a79fd221bde661b71d36064b5e4079a92045c4 Mon Sep 17 00:00:00 2001 From: Nishanth Chandra <104753233+ThisIsNishanth@users.noreply.github.com> Date: Thu, 15 Dec 2022 00:10:30 +0530 Subject: [PATCH] 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. --- docs/en/Searching/Linear-Search.md | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/docs/en/Searching/Linear-Search.md b/docs/en/Searching/Linear-Search.md index 1d4487ad..26975c3c 100644 --- a/docs/en/Searching/Linear-Search.md +++ b/docs/en/Searching/Linear-Search.md @@ -10,13 +10,20 @@ Linear search is usually very **simple to implement**. ## Steps/Algorithm: **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 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