modular exponentiation?
|
06-25-2018, 02:49 PM
(This post was last modified: 06-25-2018 03:03 PM by Bill Duncan.)
Post: #18
|
|||
|
|||
RE: modular exponentiation?
Hey everyone,
When did this forum get so serious? AFAIK, it's a place that we can share ideas, pass on a little knowledge, learn new things and most of all, have some fun! To answer a few questions, - I wasn't actually taking the test, so I didn't actually "flunk". I was trying to be funny.. - I believe my colleague actually did stipulate that the bigint library couldn't be used - He was using it as one of many interview questions, and simply looking for the mental leap. He wasn't looking for the most efficient, just something that worked. Yes, modular exponentiation can be done more efficiently. Used in cryptography etc. Some information here: Wikipedia: Modular exponentiation There is also some code for different languages on this site, rosettacode.org Recursion inefficient? Sure. Was it fun and did it work? Yes. Recursion is often not very efficient, agreed.. Some problems are way easier to design recursively however. My AWK sudoku solver I think is a good example of something far easier with a recursive design. Inefficient? Perhaps. Fast enough? Works for me. And, it was easy to translate to C for more speed. I wrote some articles about the process referenced here: awk and C sudoku solvers So seriously, let's get back to having fun with the friendly exchange of ideas in the forum? Thanks! |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)