35 Topics

Member Avatar for
Member Avatar for CLina

Hello everybody! I have to Questions to ask please: 1) How can I find the maximum value in a single linked-list recursively? this is what I tried to do: int findMax(int key){ Node max=head; while (max != null){ if (max < max.getKey()) return(max.getNext()); } } it ends up to an …

Member Avatar for CLina
0
5K
Member Avatar for globberbob

Hi there, im new to the site and am hoping someone out there can help me with my question, im pretty newbie in the world of c++ and programming in general. Im making a program with a menu, you can choose between entering a number yourself to be tested as …

Member Avatar for globberbob
0
312
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 kymarscheng

I have made a program to test if the string entered is a palindrome or not. Here's the source code: [code=c]#include <stdio.h> #include <ctype.h> #include <string.h> void clrsp(char *); void rev(const char *,char *); int main() { char str1[80],str2[80]; printf("Enter a string: "); fgets(str1,80,stdin); str1[strlen(str1)-1]='\0'; //eliminate newline clrsp(str1); //clear spaces …

Member Avatar for urjapandya
0
148
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.