1) How to find 5 most frequent apprearance workds in a words array? what if the size of the array is so big that we only need ot find approximate 5 top popular words? 2) Assume speed is more important than storage. How do you count the number of bits that will set in 32 bit integer?
Originally posted by Piggy Jing Piggy Jing: 1) How to find 5 most frequent apprearance workds in a words array? what if the size of the array is so big that we only need ot find approximate 5 top popular words? 2) Assume speed is more important than storage. How do you count the number of bits that will set in 32 bit integer?
Please help. Thanks!
Piggy Jing Piggy Jing,
Welcome to the Ranch.
Perhaps StringUtils will help you get what you want. You might also want to browse thru the ArrayUtils class in the same package to see if it helps. Let us know if it did.
Please revise your display name to meet the JavaRanch Naming Policy. To maintain the friendly atmosphere here at the ranch, we like folks to use real (or at least real-looking) names, with a first and a last name.