[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: How to make a prog more efieiant (in C)

Is this from a recent job interview, with whiteboard programming questions?

Anyway, get_max_digit() and get_sum_digits() seem perfectly reasonable.  For reverse_num() and is_symmetric(), about the only other approach I can think of is converting the numbers to strings first, do your manipulations, then convert back to integers.  It would be fewer lines of code probably, but not necessarily more efficient.

-- Kevin

Reply to: