Giter VIP home page Giter VIP logo

t9_keypad's Introduction

T9_Keypad

##A) Required input and output expected

###Input: The digits from the keypad which forms the required word.

Note: No letters are mapped to 1, *, 0 and # according to the convention followed on all the phones.

###Output: List of all the words corresponding to the digit pattern. If no word matches the pattern, no word is shown in the list.

Screenshot of digit pattern 4663

##B) Design Model and Implementation

The key functioning here is done by a modified TRIE which is a tree data structure. It involves 2 processes: ###1. Building the trie: Each node in the trie points to 10 nodes(having digits and an array of words) or null if its empty. To put a new word, convert the word into its corresponding digit pattern and according to it traverse through the trie from node to node via the pointers. If a particular node doesn't exist (ie. the pointer is null), add that node. At the last digit node, put the word associated with the pattern in the array of words of that node. ###2. Retrieving words from the pattern: To retrieve the words associated with a particular pattern, traverse through the trie via pointers and print the words in the array of the last node of the pattern. If the array is empty, no word is associated with that pattern.

Tree built for 4663 and 2564

##C) Applications

  • Text messaging
  • Searching a contact

##D) Limitations

Doesn't handle special characters like '-', ',', '.', '!', '?' etc.

t9_keypad's People

Contributors

kaustubhkhare avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.