Hi Everyone,
I’m struggling to find a valid source to know the time complexity and space complexity of functions in Random Module. Please let me know the time and space complexity of the following functions, and its valid sources to know more details.
Assume input list has N items
random.choice(input_list)
random.choices(input_list)
random.choices(input_list, k = k1) # where k1 = no of items have to be returned
random.choices(input_list, k = k1, weights = <weights/probability of items in input_list>)
random.sample(input_list)
random.sample(input_list,k) # where k = no of items have to be returned
Thank you,