That depends what exactly you mean by "constant sized". The time to find the minimum of a list with 917,340 elements is with a very large constant factor. The time to find the minimum of various lists of different constant sizes is and likely where is the size of each list. Finding the minimum of a list of 917,340 elements takes much longer than finding the minimum of a list of 3 elements.

Answer from gnasher729 on Stack Exchange
🌐
Codemia
codemia.io › home › knowledge hub › big o of min and max in python
Big O of min and max in Python | Codemia
September 24, 2025 - The time complexity of Python's built-in min() and max() is generally O(n) for iterables, because each element must be examined at least once to guarantee...
🌐
Reddit
reddit.com › r/leetcode › is the min() function considered to be o(1) in python?
r/leetcode on Reddit: Is the min() function considered to be O(1) in python?
May 2, 2023 -

Hi! I am having a hard time understanding if the builtin min function in python is of time complexity O(1). Since it might have to go through the list of elements, won't it be O(n) instead. I have seen another solution where they used 2 seperate stacks for maintaining stack and min_element. Is that a better way to do it to ensure that all methods are of O(1) time complexity? Any help is appreciated!

This is the problem I solved recently: 155. Min Stack (LC)

🌐
Pythoncomplexity
pythoncomplexity.com › builtins › min
Minimum - Python Big-O: Time & Space Complexity
# O(n*k) - evaluates key for each item words = ["apple", "pie", "cat"] shortest = min(words, key=len) # "pie" (3 letters) # More expensive key function numbers = [1, 2, 3, 4, 5] min_val = min(numbers, key=lambda x: expensive_function(x)) # O(n*k) where k = time for expensive_function · # O(n) - makes one pass through data lst = list(range(1000000)) result = min(lst) # ~1M comparisons # Same complexity with generators result = min(x**2 for x in range(10000)) # O(n) time, O(1) space
🌐
Reddit
reddit.com › r/python › time complexity of min(set, function)
r/Python on Reddit: Time complexity of min(set, function)
March 11, 2017 -

I'm implementing an algorithm and I need a data structure with both very fast lookup of arbitrary elements like you get from a hash table and similar to a priority queue very fast lookup of the highest priority element ordered by a key associated with each item.

Is there anyway I can accomplish this? I thought of just using a set and something like min(set, lambda x: x.key), would this have to iterate through all elements?

🌐
Sean Coughlin
blog.seancoughlin.me › mastering-the-minstack-efficiently-supporting-minimum-element-retrieval-in-constant-time
Efficient MinStack: Constant Time Min Element Retrieval
June 28, 2024 - The MinStack problem requires creating a stack data structure that supports the following operations, all in constant O(1) time: ... MinStack() initializes the stack object. void push(int val) pushes the element val onto the stack. void pop() ...
Find elsewhere
🌐
LabEx
labex.io › tutorials › python-how-to-use-default-value-in-min-function-419879
How to use default value in min function | LabEx
The min() function has a time complexity of O(n) for iterables, making it efficient for most use cases in LabEx programming environments. ... By understanding these basics, you'll be well-prepared to use the min() function effectively in your ...
🌐
Scribd
scribd.com › document › 730160411 › H-Standard-Algorithms
Min Time Complexity in Python Algorithms | PDF | Control Flow | Time Complexity
H - Standard Algorithms - Free download as PDF File (.pdf), Text File (.txt) or view presentation slides online.
🌐
Enterprise DNA
blog.enterprisedna.co › python-min-function
Enterprise DNA: We Help Businesses Put Data and AI to Work
I am going to be blunt about something, because I have run out of patience with it.
🌐
GeeksforGeeks
geeksforgeeks.org › python › complexity-cheat-sheet-for-python-operations
Complexity Cheat Sheet for Python Operations - GeeksforGeeks
July 12, 2025 - Python built-in data structures like lists, sets, and dictionaries provide a large number of operations making it easier to write concise code However, not understanding the complexity of these operations can sometimes cause your programs to run slower than expected.
🌐
Medium
medium.com › @kapildevkhatik2 › how-about-python-optimization-mastering-time-and-space-complexity-for-improved-performance-e094101b42f8
Python Optimization: Mastering Time and Space Complexity for Improved Performance - Techniques for Enhanced Efficiency | Medium
June 18, 2023 - Here are some techniques for improving the time complexity of your Python code: Use built-in functions: Python provides many built-in functions that are optimized for efficiency. For example, instead of looping through a list to find the minimum value, you can use the min function.
🌐
Medium
medium.com › @ashutosh0626 › time-complexity-in-python-simply-explained-88b496f29a56
Time Complexity in Python Simply Explained | by Ashutosh Sharma | Medium
April 13, 2023 - In Python programming, complexities refer to the amount of time and resources required to execute an algorithm or perform a certain…
🌐
GeeksforGeeks
geeksforgeeks.org › python › python-min-max-value-in-float-string-list
Python | Min/Max value in float string list - GeeksforGeeks
April 8, 2023 - The original list is : ['4.5', '7.8', '9.8', '10.3'] The min value of list : 4.5 The max value of list : 10.3 · Time complexity: O(n), where n is the length of the list.
🌐
Programiz PRO
programiz.pro › resources › dsa-heapify-complexity
Exploring Time and Space Complexities of Heap Operations
Therefore, the overall time complexity of extracting the min element from a heap is O(logn).
🌐
LeetCode
leetcode.com › problems › interleaving-string › solutions › 1717669 › Python:-Space-complexity:-O(min(mn))-Time-Complexity:-O(mn)
Interleaving String - LeetCode
January 25, 2022 - Can you solve this real interview question? Interleaving String - Given strings s1, s2, and s3, find whether s3 is formed by an interleaving of s1 and s2. An interleaving of two strings s and t is a configuration where s and t are divided into n and m substrings respectively, such that: * s ...
🌐
Code Like A Girl
code.likeagirl.io › python-min-heap-priority-queue-interview-prep-66f127db1176
Python Min Heap — Priority Queue-Interview Prep | by Python Code Nemesis | Code Like A Girl
November 14, 2023 - Accessing the minimum element using heap[0]: This operation has a time complexity of O(1) as it directly accesses the first element of the heap. You know all of this, and your interviewer is happy. You still have a few minutes left over from your interview, and the interviewer asks you a quick question. The heapq module in Python provides an implementation of a binary heap, a data structure that satisfies the heap property.