WAP to print all words possible with a combination of digits in T9 keypad! | My CPP Experiments!
Problem:
Program to print all the possible words for a combination of digits in T9 keypad. E.g., if the digit combination is 23 - 2 refers to character set (a,b,c) and 3 refers to character set (d,e,f). So the result should be { ad, ae, af, bd, be, bf, cd, ce, cf }. There would be a maximum of 4^n words possible for a number with n digits.Solution:
We are not using a trie here but a simplified way of storing the sequence in a character string. Will write details later.Code:
// T9Dictionary.cpp : Program to print all the words possible with a combination of
// numbers in T9 dictionary!
#include <iostream>
using namespace std;
Read full article from WAP to print all words possible with a combination of digits in T9 keypad! | My CPP Experiments!
No comments:
Post a Comment