Answers for "python min function time complexity"

0

python min function time complexity

import heapq
import random

sample = [random.randint(0, 1000) for _ in range(100)]
print(min(sample)) # O(N)

heapq.heapify(sample) # O(N)
print(sample[0]) # O(1)
Posted by: Guest on August-24-2021

Code answers related to "python min function time complexity"

Python Answers by Framework

Browse Popular Code Answers by Language