473,387 Members | 1,597 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Palindrom and check for only lowercase letters

1
Hi!

can anyone help me with this task?

im creating a palindrom :

write a recursic function whitch takes a stringobject(who only contains small letters and numbers) and checks if its a palindrom..
Feb 25 '08 #1
5 3248
Ganon11
3,652 Expert 2GB
What do you have so far?
Feb 25 '08 #2
I know that we're not supposed to post code if they have no coding but I'm doing an exercise which starts with checking if the word's a palindrom.
My coding works but I was wondering if there's a more effective way.

For the ts: my reasoning for this solution was this:
-for a palindrom the first and last letter, second and the letter before the last, ... must be the same.
-a string is an array of characters so I could just compare them.

Expand|Select|Wrap|Line Numbers
  1. Sorry friend...
  2.  
And for the lower case take a look at the cctype library it contains the function you need for the lowercase ;)
Feb 25 '08 #3
weaknessforcats
9,208 Expert Mod 8TB
Yes, you should not be posting code but since the OP needs a recursive function and your solution does not use one, I have let the code stand.
Feb 25 '08 #4
RedSon
5,000 Expert 4TB
Yes, you should not be posting code but since the OP needs a recursive function and your solution does not use one, I have let the code stand.
Sorry w4c, I didn't see your post before I removed the code. Usually we do not allow code in any question that can be commonly found in programming assignments. So, even if the user needs a recursive solution and someone posts an iterative solution we still do not allow it because if 3rd user comes in and searches for "palindrome" they will have an iterative solution.

OPs, I encourage you to post code snippets of critical areas of your code that you are questioning the logic in or wondering why it does not work. Generally posting code snippets will not get your code deleted, whereas posting entire code files will.
Feb 25 '08 #5
weaknessforcats
9,208 Expert Mod 8TB
Right you are. I didn't think of that.
Feb 25 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

10
by: Hank Kingwood | last post by:
This is probably an easy question, but I can't find a function (maybe my syntax is off...) to search for in a string. If someone would help out, I'd appreciate it! Also, how would you...
4
by: Marlon R | last post by:
What is the fastest way to tell in string contains lower case letters?
3
by: Frank van Vugt | last post by:
L.S. Either the docs or I are missing something.... While using libpq I noticed that listen/notify calls were being converted to lowercase. A further look showed that the listen/notify calls...
5
by: Todd Snyder | last post by:
I need to make a field put uppercase letters in it when a lowercase letter is entered into that field. Is there an expression to use or does it have to be written in code? *** Sent via...
2
by: chibialien57 | last post by:
hi! I need help in creating a program for converting uppercase to lowercase letters with variable arrays (single-dimension arrays). I am a bit confused. Help will be appreciated! Thanks!
3
by: den | last post by:
inner a text element if I want to allow the insertion of only: alphabet's letters a,b,c,.... and A,B,C,... number and this - and this _ and not want space blank and others characters what is...
15
by: Optimus | last post by:
I would like to know if there is a encryption algorithm that returns only lowercase encrypted string. Thanks in advance.
5
by: ashurack | last post by:
I found a stored procedure online a while back and want to inplement it. The only problem is that it doesn't check to see if the number generated is currently in use in the DB. I know it's really...
1
by: mkk572ny | last post by:
Hi, I was wondering if anyone could help me to create a java method to changing the uppercase letters to lowercase and visa versa in a string using a for-loop. Thanks.
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.