笔试面试 已知 MapReduce 程序代码块为: public static class UserMapper extends Mapper<LongWritable, Text, Text, Text> { public void map(LongWritable key, Text value, Context context) { try { String line = value.toString(); String[] words = line.split(“,”); String userName = words[0]; String friendName = words[1]; context.write(new Text(userName), new Text(friendName)); context.write(new Text(friendName), new Text(userName)); } catch (Exception e) { e.printStackTrace(); } } } public static class UserReducer extends Reducer<Text, Text, Text, Text> { List<String> userList = new LinkedList<String>(); Map<String, Integer> userFriends = new HashMap<String, Integer>(); public void reduce(Text key, Iterable<Text> values, Context context) { try { String userName = key.toString(); if(!userList.contains(userName)){ userList.add(userName); } List<String> friendsList = new ArrayList<String>(); for (Text value : values) { String friendName=value.toString(); if(!friendsList.contains(friendName)){ friendsList.add(friendName); } } userFriends.put(userName,friendsList.size()); } catch (Exception e) { e.printStackTrace(); } } protected void cleanup(Context context) { try { int userCout = userList.size(); Iterator<Map.Entry<String, Integer>> itr=userFriends.entrySet().iterator(); while (itr.hasNext()){ Map.Entry<String, Integer> word=itr.next(); String key=word.getKey(); int value=word.getValue(); DecimalFormat df=new DecimalFormat(“0.00”); context.write(new Text(key), new Text(df.format((float)value/userCout))); } } catch (Exception e) { e.printStackTrace(); } } } 内容如下的文件经过该程序处理后的输出结果为() 张三,赵八 李四,陈七 王五,陈七 钱六,张三 陈七,钱六 赵八,李四
笔试面试 甲、乙、丙、丁4位同学参加学校运动会。已知他们4人每人都至少获得1个奖项,4人获奖总数为10。关于具体获奖情况,4人还有如下说法:甲:乙和丙获奖总数为5;乙:丙和丁获奖总数为5;丙:丁和甲获奖总数为5;丁:甲和乙获奖总数为4。后来得知,获得2个奖项的人说了假话,而其他人均说了真话。根据以上信息,甲、乙、丙、丁4人具体的获奖数分别应是:
笔试面试 请问以下JS代码最终输出的结果是() let count = 0; class cls { constructor() { count++; }; }; class son extends cls {}; new son(); new son(); console.log(count);