感谢您的帮助
words = [....#Big list of words] words_set = set(words)
当 n=len(words) 时,我很难确定 set(words) 的复杂性是多少。是 O(n) 因为它在列表的所有项目上移动,还是 O(l(nl)) 当 l 是单个单词长度时?感谢帮助!如果WC和BC之间也有区别的话。
编辑:不要介意 O(l(nl)) ,重复子串大 O 是错误的。
python big-o set asymptotic-complexity python-3.x
asymptotic-complexity ×1
big-o ×1
python ×1
python-3.x ×1
set ×1