initialise a bit vector till the square root of the number and cancel out the factors of numbers with whom divisibility has been checked (starting from 2) you can use bitvector to implement it. set false for the discarded values. if none remains true (given that you initialise the bit vector with true), the number in question is prime.
On 20 September 2011 00:10, Manish Verma <jalsa.n.sa...@gmail.com> wrote: > does anybody know the fastest algo for prime factorization of a > number??? > > -- > 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. > > -- Regards Siddharth Srivastava -- 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.