implementing palindrome using stack in c++

April 2, 2011 at 22:17:30
Specs: N/A
can we store each element inside the stack in a single variable and check?
i.e
ele=stk[top]
while(ele>o)
{
ele=ele%10;
res=res*10+ele;
ele=ele/10;
}
if(res==ele)
cout<<"palindrome";

See More: implementing palindrome using stack in c++

Report •


#1
April 2, 2011 at 22:19:53
is this code correct?

Report •
Related Solutions


Ask Question