Topic:
Parallel Linear
Search
Presented by | Mamoona Shafiq 65
Table of Contents
Introduction
Slide no 1: Understanding parallel
computing
Parallel Linear search concept
Step-by-Step Working of Parallel
Linear Search
Algorithm & Example
Advantages & Challenges
Slide no 2: Introduction
What is a Linear Search?
Linear Search is a simple searching algorithm used to find an element in
an array or list.
It checks each element one by one until the target is found or the list
ends.
Why Do We Need Parallelization?
● For large datasets, sequential search can be slow.
● Modern processors support multi-threading and parallel execution.
● Parallel Linear Search speeds up the process by dividing tasks among
multiple processors.
Slide no 3: How Does Linear Search Work
in Parallel?
Parallel Linear Search improves efficiency by dividing the workload among
multiple processors or threads. Here’s how it works:
Divide the Data
1️
1️
⃣
● The given array is split into equal-sized chunks based on the number
of available processors.
Slide no 4: How Does Linear Search Work
in Parallel? (cont….)
Example:
● Array: [3, 7, 1, 9, 5, 6, 8, 2]
● Processors: 4
● Each processor gets 2 elements:
○ P1: [3, 7]
○ P2: [1, 9]
○ P3: [5, 6]
○ P4: [8, 2]
Slide no 5: Cont….
Assign Each Part to a Processor
2️
⃣
● Each processor searches its assigned subarray independently.
● The search operation is performed simultaneously on different parts
of the array.
Slide no 6: Cont….
3 ️
3️⃣ Perform Linear Search in Parallel
● Each processor starts checking elements one-by-one within its
assigned portion.
● If a match is found, it is reported immediately to stop unnecessary
computations.
● If multiple processors find the target, the lowest index is selected.
Slide no 7: Cont….
4️⃣ Merge Results
● The processors communicate their results using synchronization
mechanisms.
● If the element is found in multiple places, the smallest index is
returned.
● If no processor finds the element, the final output is "Not Found"
.
Slide no 8: Example execution
Given Array:
[3, 7, 1, 9, 5, 6, 8, 2]
Target Element: 6
Processor Assignments:
● P1: [3, 7]
● P2: [1, 9]
● P3: [5, 6] (✅ Found at index 5)
● P4: [8, 2]
.
Slide no 9: Final output
● Processor P3 reports index 5 as the first occurrence of 6.
● Other processors stop searching.
● The final result is returned efficiently.
Slide no 10: Key Benefits of Parallel Linear
Search
✔ Faster than sequential search for large datasets.
✔ Reduces execution time by leveraging multiple processors.
✔ Efficient for distributed computing environments.
Slide no 11: Applications
✅ Large-scale data retrieval
✅ AI & Machine Learning data processing
✅ Searching in distributed databases
Slide no 12: Parallel Linear Search vs. Other
Search Methods
Slide no 13: Conclusion
● Parallel computing speeds up linear search
● Effective for large-scale search tasks
● Trade-off between speedup & overhead
Any question?
Thank you!

Parallel linear search how does linear search work in parallel.pptx

  • 1.
  • 2.
    Table of Contents Introduction Slideno 1: Understanding parallel computing Parallel Linear search concept Step-by-Step Working of Parallel Linear Search Algorithm & Example Advantages & Challenges
  • 3.
    Slide no 2:Introduction What is a Linear Search? Linear Search is a simple searching algorithm used to find an element in an array or list. It checks each element one by one until the target is found or the list ends. Why Do We Need Parallelization? ● For large datasets, sequential search can be slow. ● Modern processors support multi-threading and parallel execution. ● Parallel Linear Search speeds up the process by dividing tasks among multiple processors.
  • 4.
    Slide no 3:How Does Linear Search Work in Parallel? Parallel Linear Search improves efficiency by dividing the workload among multiple processors or threads. Here’s how it works: Divide the Data 1️ 1️ ⃣ ● The given array is split into equal-sized chunks based on the number of available processors.
  • 5.
    Slide no 4:How Does Linear Search Work in Parallel? (cont….) Example: ● Array: [3, 7, 1, 9, 5, 6, 8, 2] ● Processors: 4 ● Each processor gets 2 elements: ○ P1: [3, 7] ○ P2: [1, 9] ○ P3: [5, 6] ○ P4: [8, 2]
  • 6.
    Slide no 5:Cont…. Assign Each Part to a Processor 2️ ⃣ ● Each processor searches its assigned subarray independently. ● The search operation is performed simultaneously on different parts of the array.
  • 7.
    Slide no 6:Cont…. 3 ️ 3️⃣ Perform Linear Search in Parallel ● Each processor starts checking elements one-by-one within its assigned portion. ● If a match is found, it is reported immediately to stop unnecessary computations. ● If multiple processors find the target, the lowest index is selected.
  • 8.
    Slide no 7:Cont…. 4️⃣ Merge Results ● The processors communicate their results using synchronization mechanisms. ● If the element is found in multiple places, the smallest index is returned. ● If no processor finds the element, the final output is "Not Found" .
  • 9.
    Slide no 8:Example execution Given Array: [3, 7, 1, 9, 5, 6, 8, 2] Target Element: 6 Processor Assignments: ● P1: [3, 7] ● P2: [1, 9] ● P3: [5, 6] (✅ Found at index 5) ● P4: [8, 2] .
  • 10.
    Slide no 9:Final output ● Processor P3 reports index 5 as the first occurrence of 6. ● Other processors stop searching. ● The final result is returned efficiently.
  • 11.
    Slide no 10:Key Benefits of Parallel Linear Search ✔ Faster than sequential search for large datasets. ✔ Reduces execution time by leveraging multiple processors. ✔ Efficient for distributed computing environments.
  • 12.
    Slide no 11:Applications ✅ Large-scale data retrieval ✅ AI & Machine Learning data processing ✅ Searching in distributed databases
  • 13.
    Slide no 12:Parallel Linear Search vs. Other Search Methods
  • 14.
    Slide no 13:Conclusion ● Parallel computing speeds up linear search ● Effective for large-scale search tasks ● Trade-off between speedup & overhead
  • 15.
  • 16.