You cn also use modified BFS with mappings from numbers to its
corresponding paths and print the paths from the root.
On Mar 12, 7:45 am, xyz69 pawelszc...@gmail.com wrote:
Number 1, doesn't represent any letter.
pseudocode, (numbers is array of numbers, currentString is currently
composed string to show)
function printChar(numbers, currentString){
for (every letter coded as numbers[0]){
if (numbers.lenght1){
printChar(numbers[1:], currentString+letter)
} else {
print(currentString+letter)
}
}
}
On 11 Mar, 16:45, bittu shashank7andr...@gmail.com wrote:
Hy Guys I want to do . for any phone number .. the program should
print out all the possible strings it represents. For eg.) 2 in the
number can be replaced by 'a' or 'b' or 'c', 3 by 'd' 'e' 'f' etc. In
this way how many possible permutations can be formed from a given
phone number. I don't want anyone to write code for it ... a good
algorithm or psuedocode would be great.
I am talking about old small phone where a single digit corresponds
to 3charcter from digit 2 to 8 and digit 9 has 4 character w x y
z ..Hope everyone got my points what i wants well i tried my solution
but thats become so complex so now even i am facing to understand that
so will anybody try this interesting question .
more clearly for digit o/p is
AD
AE
AF
BD
BE
BF
CD
CE
CF
Now You Can Imegin what will be o/p for 9740852296 or any 10 digit
number
Think as much as you can but finally solution matters ..
Thanks Regards
Shashank Mani
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.