Next Publication In:
Days: 00
Hours: 00
Minutes: 00
Seconds: 00

SEARCHING FOR THE MAXIMUM ELEMENT IN A VECTOR USING BUILT-IN FUNCTION max() AND LOCATING THE MAXIMUM ELEMENT FROM THE VECTOR USING POPULAR SEARCHING TECHNIQUE BINARY SEARCH METHODOLOGY: A CASE STUDY

📘 Volume 12 📄 Issue 7 📅 July 2026

👤 Authors

R Daranish 1
1. 6780-Student, Class- XII , 2026-27 , Sainik School Amaravathinagar , Post: Amaravathinagar, Udumalpet Taluka, Tirupur Dt, Tamilnadu State

📄 Abstract

This paper looks at a question that sounds almost too simple to deserve a research paper of its own: what is the fastest, most reliable way to find the largest value sitting inside a vector? Most programmers reach for Python's built-in max() function without a second thought, and for good reason - it is short, it is readable, and it almost always works. But once a vector is already sorted, a second option opens up. Because the maximum element of a sorted list sits at a fixed, predictable position, a binary-search style walk toward that position can, in principle, locate it without touching every element along the way. We set out to test this idea properly rather than take it on faith. Three additional approaches were brought into the comparison alongside max() and the sorted binary-search method - a classical divide-and-conquer max finder, a tournament-style pairwise elimination method, and a simple threaded variant of max() intended to see whether parallel execution offers any real benefit on commodity hardware. Each method was implemented in Python, profiled across vector sizes ranging from one hundred elements up to one million elements, and measured for execution time, comparison count, and peak memory consumption. The results, on the whole, confirm what the theory predicts but with a few wrinkles that are easy to miss on paper. max() remains the most practical default for everyday, unsorted data because of how tightly CPython's C implementation is written. The binary-search approach is genuinely fast once a vector is sorted, although the cost of sorting itself, when it has to be paid, erases nearly all of the advantage. Divide-and-conquer performs comparably to max() in terms of comparisons but suffers from recursion overhead in Python. The tournament method, somewhat surprisingly, was the most comparison-efficient of all, needing close to n - 1 comparisons in the best structured cases, though its real-world runtime did not always reflect that theoretical elegance because of interpreter-level overhead. We close with a discussion of where each technique earns its keep and offer some practical recommendations for choosing between them.

📚 How to Cite:

R Daranish , SEARCHING FOR THE MAXIMUM ELEMENT IN A VECTOR USING BUILT-IN FUNCTION max() AND LOCATING THE MAXIMUM ELEMENT FROM THE VECTOR USING POPULAR SEARCHING TECHNIQUE BINARY SEARCH METHODOLOGY: A CASE STUDY , Volume 12 , Issue 7, July 2026, EPRA International Journal of Multidisciplinary Research (IJMR) , Pages: 17 - 22 ,

🔗 PDF URL

https://cdn.eprapublishing.org/article/1783191379623-2.EPRA28575.pdf

📄 PDF Preview

Click the button above to load the PDF.