C language interview questions solution for freshers beginners placement tricky good pointers answers explanation operators data types arrays structures functions recursion preprocessors looping file handling strings switch case if else printf advance linux objective mcq faq online written test prime numbers Armstrong Fibonacci series factorial palindrome code programs examples on c++ tutorials and pdf
Not bad, but "bignum / normal integer" is the easy part... the basic algorithm...
you should bugfix the part with division by too large numbers... (MAX LONG + 1) / (MAX LONG) would not work I guess, because there would be an overflow before the division occurs...
next step would be -not using human read-able ascii --> use of binary numbers (less space needed and faster) - +/- numbers - bignum div by bignum or (even if not needed:) - floating support
3 comments:
very good algorithm!
but what happens when the divisor has MAX digits too??
Not bad, but "bignum / normal integer" is the easy part... the basic algorithm...
you should bugfix the part with division by too large numbers...
(MAX LONG + 1) / (MAX LONG) would not work I guess, because there would be an overflow before the division occurs...
next step would be
-not using human read-able ascii --> use of binary numbers (less space needed and faster)
- +/- numbers
- bignum div by bignum or (even if not needed:)
- floating support
why to store as string first and then to integer array?
why don't you directly store in integer array?
Post a Comment