Lab: Linear Search, Insertion Sort

Site: DIU Blended Learning Center
Course: Algorithm -SMAH(Fall 2022)
Book: Lab: Linear Search, Insertion Sort
Printed by: Guest user
Date: Friday, 27 September 2024, 1:17 PM

Linear Search


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


Insertion Sort



Class Discussion: Section: PC-B Week-3



Class Discussion: Section: PC-A Week-3