1,2), alternativenum = c(342, 5921), text = c("one text here","another text here also")) 如何在此数据框中添加一个新列,其中使用text列的每一行都包含一个单词计数器?data.frame(id = c(1,2), alternativenum = c(342, 5921), text = c("one text here","another text here al
这使我认为,如果我使用比较排序方法,时间复杂度的下限将是O (n log )。所以,我的想法是,最好的方法是实现计数排序。这是我的密码。此外,我还想知道,这是否实际上是一个好办法,是否有任何替代办法将在实践中使用。### n is number of characters in string, k is number of words ### words(/\s/) # O(n) min = Float::INFINITY