4 Reusable Code Snippet Topics

Remove Filter
Member Avatar for
Member Avatar for TrustyTony

Here is slow brute force way to find the largest palindromic product of three digit integers. You could do loop and break out of it if you go under the smaller number (the second one) of best solution found so far to be more efficient etc.

Member Avatar for hughesadam_87
0
544
Member Avatar for TrustyTony

As [URL="http://www.daniweb.com/software-development/c/threads/377568/1625821#post1625821"]Goddess Narues' C code in C forum[/URL] was over my head and her critique of simplistic solution maybe overflowing the integer range was valid in C, I worked out a recursive solution more suitable to my brain in my preferable language. Maybe one day I put in C, now …

0
247
Member Avatar for ashishkumar008

Hi....... This code is useful to check given string is palindrome or not. Actually, there are some other way also to check palindrome. So, be careful which code gives better efficiency. You can [COLOR="Red"]comment the line[/COLOR][COLOR="Green"]-bool caseignore= str.Equals(revstr, StringComparison.OrdinalIgnoreCase);[/COLOR] and in [B][COLOR="Red"]if[/COLOR][/B] condition you can use- if(string.Compare(str,revstr,true)==0)

Member Avatar for vijaykrishnabor
0
303
Member Avatar for NathanOliver

Hey all I have seen a lot of stuff about palindrome checkers so I thought I would write one that works for STL containers as well as arrays. it accepts a bidirectional iterator to the first element and an bidirectional iterator to 1 after the last element. Included is a …

Member Avatar for NathanOliver
3
326

The End.