首页 > 试题广场 >

词频统计

[编程题]词频统计
  • 热度指数:7487 时间限制:C/C++ 3秒,其他语言6秒 空间限制:C/C++ 32M,其他语言64M
  • 算法知识视频讲解

给定一个string数组article及其大小n及一个待统计单词word,请返回该单词在数组中出现的频数。文章的词数在1000以内。

头像 一直在i
发表于 2020-10-20 10:18:50
import java.util.*; public class Frequency { public int getFrequency(String[] article, int n, String word) { // write code here int n 展开全文
头像 果粒陈33
发表于 2022-06-20 15:31:15
# -*- coding:utf-8 -*- class Frequency: def getFrequency(self, article, n, word): # write code here n = 0 for s in articl 展开全文
头像 mythwind
发表于 2022-04-07 11:21:34
简单 import java.util.*; public class Frequency { public int getFrequency(String[] article, int n, String word) { // write code here int num = 0; for (i 展开全文