For example:
my_list = list(my_set)
my_set = set(my_list)
I often needs to convert them for some index based iteration or efficient loop up. Are they linear for those two operations?
If it is linear, this conversion below is unnecessary?
my_list = [1,2,3,4]
for n in my_list:
if n == '2':
print(yes)
my_set = set(my_list)
if '2' in my_set:
print(yes)
NO need to change the list to set. Right?