Please Visit: http://ift.tt/1ajReyV
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1tqsvqQ
via LifeLong Community
DFA based division | GeeksforGeeks
Deterministic Finite Automaton (DFA) (Link->http://ift.tt/1n1hvIj) can be used to check whether a number “num” is divisible by “k” or not. If the number is not divisible, remainder can also be obtained using DFA.
We consider the binary representation of ‘num’ and build a DFA with k states. The DFA has transition function for both 0 and 1. Once the DFA is built, we process ‘num’ over the DFA to get remainder.
http://ift.tt/1tqsvqO
http://ift.tt/1n1hvIl
Deterministic Finite Automaton (DFA) (Link->http://ift.tt/1n1hvIj) can be used to check whether a number “num” is divisible by “k” or not. If the number is not divisible, remainder can also be obtained using DFA.
We consider the binary representation of ‘num’ and build a DFA with k states. The DFA has transition function for both 0 and 1. Once the DFA is built, we process ‘num’ over the DFA to get remainder.
http://ift.tt/1tqsvqO
http://ift.tt/1n1hvIl
from Public RSS-Feed of Jeffery yuan. Created with the PIXELMECHANICS 'GPlusRSS-Webtool' at http://gplusrss.com http://ift.tt/1tqsvqQ
via LifeLong Community
No comments:
Post a Comment