c++ - Palindrome without using extra space -


i know various ways check if integer palindrome or not using string conversion, stack , number breaking, here question "how can check wether integer palindrome or not, without using any extra space?"

you can revert number code like:

int revert(int num) {   int reverted = 0;   while (num) {     reverted = reverted*10 + num%10;     num /= 10;   }   return reverted; } 

and check if

num == revert(num)

that all. sorry giving exact solution instead of tip, don't think have given tip without solution itself.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -