Results 1 to 3 of 3
Thread: Letter Frequency
- 01-21-2013, 09:47 PM #1
Member
- Join Date
- Jan 2013
- Posts
- 7
- Rep Power
- 0
Letter Frequency
I need help creating a letter frequency method. I can't figure it out. I need a simple way. I've searched and most of the them use char and other stuffe I haven't learned yet. I only know basic stuff like for loops, int[], string[], if, else, .indexOf, compareto, .equals, and other basic stuff
this is the code given to me
Java Code:public static void letterFreqeuncy(String s) { }Last edited by laxbro; 01-21-2013 at 10:19 PM.
- 01-22-2013, 02:11 AM #2
Member
- Join Date
- May 2012
- Posts
- 17
- Rep Power
- 0
Re: Letter Frequency
Using Chars is easy, but if you really dont want to you cant get an array of strings of the letters like this.
Then you can probably figure out the rest.Java Code:String[] letters = new String[s.length()]; for(int i = 0; i < s.length(); i++) { letters[i] = "" + s.charAt(i); }
But if you want to learn chars just follow this link: Primitive Data Types (The Java™ Tutorials > Learning the Java Language > Language Basics)
- 01-22-2013, 09:07 AM #3
Re: Letter Frequency
@J-max04: s.toCharArray() does the same and it doesn't reall help.
@laxbro: How would you do it with a pencil and paper? You know everything to do solve this.Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
The Ubiquitous Newbie Tips
Similar Threads
-
Sound Frequency
By MemoNick in forum New To JavaReplies: 10Last Post: 11-05-2011, 10:29 PM -
frequency of occurence of a letter in a string
By manish007g in forum New To JavaReplies: 4Last Post: 06-23-2011, 09:05 PM -
Sort Frequency
By ScaryJello in forum New To JavaReplies: 7Last Post: 03-26-2009, 12:47 AM -
Word Frequency
By capu in forum Advanced JavaReplies: 2Last Post: 10-09-2008, 02:03 PM -
Frequency Counter
By justlearning in forum New To JavaReplies: 0Last Post: 05-07-2008, 10:50 PM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks