`
cynhafa
  • 浏览: 155260 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

查找字符串中出现次数最多的字符

 
阅读更多
/** * 查找字符串中出现次数最多的字符 * @author YangHui 2009-10-14 * */ @SuppressWarnings("unchecked") public class Baidu { private static String words = "iloveyou"; private static String[] strs = {"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"}; private static HashMap map = null; /** * 按照26个字母,将给出的字符串中字符出现的次数统计 * @param words * @return */ public HashMap manyword(String words) { map = new HashMap(); char[] word = words.toLowerCase().toCharArray(); for (int i = 0; i <!-- Baidu Button BEGIN -->
更多
<!-- Baidu Button END --> <!--192.168.100.33-->
<!-- Baidu Button BEGIN --> <script type="text/javascript" id="bdshare_js" data="type=tools&amp;uid=1536434"></script><script type="text/javascript" id="bdshell_js"></script><script type="text/javascript"> document.getElementById("bdshell_js").src = "http://bdimg.share.baidu.com/static/js/shell_v2.js?cdnversion=" + Math.ceil(new Date()/3600000) </script><!-- Baidu Button END -->
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics