Python functions.
1. Given a list of words, return an array which indicates the frequency that
each letter occurs. For example, in the list ["apple", "bob"], [ 'a' -> 1,
'b'->2, 'e'->1, 'l'->1, 'o'->, 'p'->2] . The order of the array does not
matter and a Frequency class will be provided.
2. Given a list of words, indicate whether the list constitutes a "Word Lad-
der." Return a True or False (Boolean) A Word Ladder is a series of words where each succeeding word
changes by only one letter. You may not assume that all words will be of
the same length, and you may not assume the length of the list.
3. Given an integer greater than 2, X, return an array populated with all
prime numbers up to and including X.
hodna1
0
Newbie Poster
Recommended Answers
Jump to PostThis is a java forum.
For the first, you can have an int array of length the number of letters in the alphabet (24 or 26)
Loop each String of the list and take each character and increase the right element of the array by one.
the first element for …
Jump to PostCompare each character of 2 words. If you find more than 1 change or you find zero changes then the list is not a word ladder
All 6 Replies
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
hodna1
0
Newbie Poster
hodna1
0
Newbie Poster
javaAddict
900
Nearly a Senior Poster
Team Colleague
Featured Poster
peter_budo
2,532
Code tags enforcer
Team Colleague
Featured Poster
jwenting
1,889
duckman
Team Colleague
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.