文档介绍:更多面试题,笔试题解答答案专家回答:第一题简评百度的主要业务是搜索,。,以一定的格式保存在能快速检索的文件系统中。。由以上3点可见,字符串的分析,抽取在搜索引擎中的地位是何等重要。因此,百度的笔试面试题中,出现这样的题就变得理所当然了。以下是该题的java实现,代码如下:.*;.*;.*;/******@authortzy**/lassFileNameStat{privateStringsrcPath;//要统计的文件路径privateMapstatMap;//用于统计的mappublicFileNameStat(StringsrcPath){=srcPath;软件开发网Map=newTreeMap();}/*获得要统计的URL的文件名*/publicStringgetFileName(StringurlString){URLurl=null;StringfilePath=null;StringfileName=null;try{url=newURL(urlString);filePath=();intindex=0;if((index=("/"))!=-1){fileName=(index+1);}else{fileName="";}}catch(MalformedURLExceptione){}returnfileName;}/*统计指定文件名的个数*/publicvoidstat(Stringfilename){Integercount=null;if((filename)!=null){count=(Integer)(filename);count=newInteger(()+1);}else{count=newInteger(1);}(filename,count);}/*统计的主方法*/publicvoidstart()throwsFileNotFoundException,IOException{BufferedReaderbfin=newBufferedReader(newFileReader());Stringtemp=null;while((temp=())!=null){stat(getFileName(temp));}}/*输出统计结果*/publicvoidresult(){Iteratorit=().iterator();while(()){=()(());((().equals("")?"空文件名":())+"的个数是"+