Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation

Fuente: arXiv
Guardado en:
Detalles Bibliográficos
Autores principales: Zinnia, Nazma Akter, Hanada, Eisuke
Formato: Preprint
Publicado: 2024
Materias:
Acceso en línea:
Etiquetas: Agregar Etiqueta
Sin Etiquetas, Sea el primero en etiquetar este registro!
_version_ 1866917703479984128
author Zinnia, Nazma Akter
Hanada, Eisuke
author_facet Zinnia, Nazma Akter
Hanada, Eisuke
contents This report investigates three fundamental search algorithms: Linear Search, Binary Search, and Two Pointer Search. Linear Search checks each element sequentially, Binary Search divides the search space in half, and Two Pointer Search uses two pointers to scan from both ends of a sorted list. We compare these algorithms in terms of time complexity, space complexity, and practical performance. Our findings demonstrate that while Linear Search is straightforward, it is inefficient for large datasets. Binary Search is efficient for sorted data but requires an initial sorting step. The Two Pointer Search, combining elements of both methods, offers a practical balance of simplicity and efficiency. We propose a novel implementation of the Two Pointer Search algorithm and validate its performance through comprehensive testing on various hardware configurations. The results indicate that our proposed algorithm significantly improves search efficiency, making it suitable for both sorted and unsorted datasets. Future work will extend this algorithm to more complex data structures and real-world applications.
format Preprint
id arxiv_https___arxiv_org_abs_2406_16729
institution arXiv
publishDate 2024
record_format arxiv
spellingShingle Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation
Zinnia, Nazma Akter
Hanada, Eisuke
Data Structures and Algorithms
This report investigates three fundamental search algorithms: Linear Search, Binary Search, and Two Pointer Search. Linear Search checks each element sequentially, Binary Search divides the search space in half, and Two Pointer Search uses two pointers to scan from both ends of a sorted list. We compare these algorithms in terms of time complexity, space complexity, and practical performance. Our findings demonstrate that while Linear Search is straightforward, it is inefficient for large datasets. Binary Search is efficient for sorted data but requires an initial sorting step. The Two Pointer Search, combining elements of both methods, offers a practical balance of simplicity and efficiency. We propose a novel implementation of the Two Pointer Search algorithm and validate its performance through comprehensive testing on various hardware configurations. The results indicate that our proposed algorithm significantly improves search efficiency, making it suitable for both sorted and unsorted datasets. Future work will extend this algorithm to more complex data structures and real-world applications.
title Optimizing Search Strategies: A Study of Two-Pointer Linear Search Implementation
topic Data Structures and Algorithms
url https://arxiv.org/abs/2406.16729