Palindrome is A palindrome is a word, phrase, number, or other sequence of symbols or elements, whose meaning may be interpreted the same way in either forward or reverse direction.(wiki answer).
Two check given string is palindrome or not.It is very easy if we use double link list.
Two check given string is palindrome or not.It is very easy if we use double link list.
Procedure :-
::- insert each char of string in double link list with each node contain only one char.
::- intialise "HEAD" to first node & "TELL" to last node.
::- check data at first node & last node then increment head & decrement in tell than check again untill any mismatch found or they reaches to mid of list
::- intialise "HEAD" to first node & "TELL" to last node.
::- check data at first node & last node then increment head & decrement in tell than check again untill any mismatch found or they reaches to mid of list
;;- IF all are match than it is successful condition else unsuccessful
C program :-
//palindrome;
//if you found spelling mistake anywhere please ignore
#include<stdio.h>
#include<stdlib.h>
#include<malloc.h>
#include<string.h>
int create(char);
int check(int);
struct node
{
char c;
struct node *fro;
struct node *back;
}*head=NULL,*tell=NULL; // to pointer head point to first node & tell point to last node
//initialy list is empty so head=tell=NULL
typedef struct node node;
main()
{
char arr[20];
int m,i;
printf("\n enter string to check :");
scanf("%s",&arr);
m=strlen(arr); // calculating lenghth of string
printf("\n length of string is %d",m);
for(i=0;i<m;i++)
{
create(arr[i]); // creating a double ling list with each node containning a single char
}
display();
check(m);
}
create(char ch) // creating double link list
{
node *temp,*r;
temp=head;
r=(node*)malloc(sizeof(node)); // allocating space node dynamicaly
r->c=ch;
if(head == NULL)
{
head=r;
tell=r;
head->fro=NULL;
head->back=NULL;
}
else
{
tell->fro=r;
r->back=tell;
tell=tell->fro;
tell->fro=NULL;
}
}
display()
{
node *temp;
temp=head;
printf("\n\n\t");
while(temp != NULL) // traverse list & print volue
{
printf("%c",temp->c);
temp=temp->fro;
}
}
check(int m) // funtion check our requrement
{
node *tf,*tt;
tf=head;
tt=tell;
while(m/2 > 0)
{
if(tf->c == tt->c)
{
tf=tf->fro;
tt=tt->back;
}
else
{
printf("\n\n\t not a palidrome :???");
exit(0);
}
m--;
}
printf("\n\n\t it is palidrome !!!!");
}
You have made some really good points there. I checked on the web
ReplyDeleteto find out more about the issue and found most people will go along with your views on this web site.
Feel free to visit my page ... Christian Louboutin Boots
Greate post. Keep posting such kind of information on your
ReplyDeletepage. Im really impressed by it.
Hello there, You have performed an incredible job.
I will certainly digg it and personally suggest to my friends.
I'm confident they will be benefited from this site.
My homepage propane cylinder sizes chart
Superb post however I was wondering if you could write a litte more on this topic?
ReplyDeleteI'd be very grateful if you could elaborate a little bit more.
Thank you!
Look at my web blog: Vietnam tours
Having read this I believed it was very enlightening.
ReplyDeleteI appreciate you spending some time and energy to put this informative article together.
I once again find myself spending way too much time both reading
and leaving comments. But so what, it was still worthwhile!
Stop by my web page Louis Vuitton Online
Thanks very interesting blog!
ReplyDeleteAlso visit my web-site; Louboutin Shoes
I visit each day a few blogs and information sites to read posts, however
ReplyDeletethis website offers quality based content.
My blog Christian Louboutin Outlet
What's up, after reading this awesome post i am as well happy to share my know-how here with colleagues.
ReplyDeletemy web blog - Louboutin Shoes
I do not even know the way I finished up here,
ReplyDeletehowever I thought this publish was once great.
I do not know who you're however definitely you're going to a well-known blogger in the event you aren't already.
Cheers!
my website - Christian Louboutin Heels
I enjoy what you guys tend to be up too. This sort of clever work and reporting!
ReplyDeleteKeep up the wonderful works guys I've included you guys to our blogroll.
Here is my site - Christian Louboutin Pumps
I absolutely love your website.. Pleasant colors & theme.
ReplyDeleteDid you build this site yourself? Please reply back as I'm looking to create my very own site and want to find out where you got this from or exactly
what the theme is named. Kudos!
Here is my web page: Christian Louboutin Boots
First off I would like to say great blog! I had a quick
ReplyDeletequestion that I'd like to ask if you do not mind. I was curious to find out how you center yourself and
clear your head prior to writing. I have had a hard time clearing my thoughts in getting my
ideas out there. I do enjoy writing but it just seems like the first
10 to 15 minutes tend to be wasted just trying to figure out
how to begin. Any ideas or hints? Many thanks!
Also visit my site ... Louis Vuitton Cheap
I am in fact thankful to the owner of this web page who has shared this enormous article at here.
ReplyDeleteMy website ... Louis Vuitton Outlet Store
whoah this blog is fantastic i love reading your
ReplyDeleteposts. Stay up the good work! You know, lots of individuals are hunting around for this information, you can aid them greatly.
Also visit my site - Louis Vuitton Handbags
This info is worth everyone's attention. Where can I find
ReplyDeleteout more?
Also visit my site ... Replica Louis Vuitton
I am truly pleased to glance at this blog posts which carries tons of valuable facts, thanks
ReplyDeletefor providing these data.
my homepage: Louis Vuitton Cheap
Hi there to all, it's truly a fastidious for me to pay a visit
ReplyDeletethis site, it consists of priceless Information.
Here is my homepage Louis Vuitton Outlet Store
whoah this weblog is excellent i really like reading your articles.
ReplyDeleteStay up the great work! You recognize, lots of persons are hunting around for this
information, you can help them greatly.
My web-site: Beats By Dre Solo
Hello just wanted to give you a quick heads up.
ReplyDeleteThe text in your content seem to be running off the screen in Ie.
I'm not sure if this is a formatting issue or something to do with web browser compatibility
but I thought I'd post to let you know. The layout look great
though! Hope you get the problem resolved soon. Cheers
Also visit my web page - Louis Vuitton Online
Your way of explaining the whole thing in this article is actually pleasant,
ReplyDeleteevery one be capable of without difficulty be aware of it, Thanks a lot.
my web page - Fake Louis Vuitton Bags
I was pretty pleased to uncover this page. I need to to thank you for your time for this particularly wonderful read!!
ReplyDeleteI definitely enjoyed every bit of it and I have you book-marked
to see new stuff on your web site.
my web site; Christian Louboutin Heels
Thanks for sharing your thoughts about pelf. Regards
ReplyDeleteFeel free to surf to my site Louboutin Shoes
Fine way of explaining, and good post to take data about my presentation topic, which i am going to deliver in institution of higher
ReplyDeleteeducation.
Also visit my web blog ... Christian Louboutin Outlet
First off I want to say wonderful blog! I had a quick question that I'd like to ask
ReplyDeleteif you don't mind. I was interested to find out how you center yourself and clear your mind prior to writing.
I've had a hard time clearing my thoughts in getting my ideas out there.
I truly do enjoy writing but it just seems like the first 10 to 15
minutes tend to be lost simply just trying to figure out how to
begin. Any suggestions or hints? Cheers!
my web page :: Christian Louboutin Shoes
Hey there, You have done an excellent job. I'll definitely digg it and personally suggest to my friends.
ReplyDeleteI'm sure they will be benefited from this website.
Feel free to surf to my weblog - Christian Louboutin Outlet
What a information of un-ambiguity and preserveness of precious knowledge regarding unpredicted emotions.
ReplyDeleteMy blog ... christian Louboutin heels
Hello! Quick question that's totally off topic.
ReplyDeleteDo you know how to make your site mobile friendly?
My website looks weird when viewing from my iphone 4.
I'm trying to find a template or plugin that might be able to fix this problem.
If you have any recommendations, please share. Appreciate
it!
Take a look at my web blog; Christian Louboutin Replica
I blog frequently and I truly appreciate your information. This great article
ReplyDeletehas truly peaked my interest. I am going to book mark your blog and
keep checking for new information about once a week.
I subscribed to your RSS feed as well.
my homepage: Christian Louboutin Boots
Great article, totally what I was looking for.
ReplyDeletemy website - Christian Louboutin Boots
Appreciate this post. Will try it out.
ReplyDeletemy page: Christian Louboutin Shoes
Every weekend i used to pay a quick visit this web page, for the reason that i want enjoyment, since this this web site
ReplyDeleteconations genuinely fastidious funny data too.
my web site ... Christian Louboutin Pumps
Good day I am so grateful I found your site,
ReplyDeleteI really found you by accident, while I was browsing on Aol for something else, Nonetheless I am here now
and would just like to say thanks a lot for a remarkable post and a all round exciting blog (I also love the
theme/design), I don't have time to read through it all at the moment but I
have bookmarked it and also included your RSS feeds, so when I have time
I will be back to read more, Please do keep up
the excellent work.
My homepage: Christian Louboutin Heels
Definitely imagine that that you stated. Your favorite justification appeared to be at
ReplyDeletethe web the simplest factor to be mindful of.
I say to you, I definitely get irked whilst other people consider worries that they plainly do not know
about. You managed to hit the nail upon the highest and
outlined out the whole thing without having side effect ,
people could take a signal. Will probably be again to get more.
Thank you
my page - Replica New Balance
Yesterday, while I was at work, my cousin stole my apple ipad
ReplyDeleteand tested to see if it can survive a thirty foot drop,
just so she can be a youtube sensation. My iPad is now destroyed and she has 83
views. I know this is entirely off topic but I had to share it with someone!
Also visit my blog post ... Cheap Dr Dre Beats
You can definitely see your skills in the article you write.
ReplyDeleteThe arena hopes for more passionate writers such as
you who are not afraid to say how they believe. Always go after your heart.
My webpage; Replica Christian Louboutin
I'm not sure why but this weblog is loading very
ReplyDeleteslow for me. Is anyone else having this problem or is it a issue on my end?
I'll check back later and see if the problem still exists.
Feel free to surf to my blog post Beats Headphones
Oh my goodness! Awesome article dude! Thank you so much, However I am encountering
ReplyDeleteissues with your RSS. I don't understand the reason why I cannot join it.
Is there anyone else getting similar RSS issues? Anyone that knows the answer
can you kindly respond? Thanks!!
Also visit my web site; Louis Vuitton Replica
What's Happening i'm new to this, I stumbled upon this I've discovered
ReplyDeleteIt absolutely helpful and it has aided me out loads.
I am hoping to give a contribution & aid different users like its aided me.
Great job.
Look at my web blog - Dr Dre Headphones
My brother suggested I may like this website.
ReplyDeleteHe used to be entirely right. This put up truly made my day.
You can not believe just how a lot time I had spent for this info!
Thank you!
Review my site: Christian Louboutin Replica
Incredible! This blog looks exactly like my old one!
ReplyDeleteIt's on a entirely different subject but it has pretty much the same
layout and design. Wonderful choice of colors!
Feel free to surf to my web-site - Louis Vuitton Bags
I love your blog page and your strategy - iit is genuinely cool to know there's more individuals out there which express exactly the same concepts.
ReplyDeleteAlso visit my webpage; eliquid
Greetings, There's no doubt that your website may be having internet browser compatibility issues.
ReplyDeleteWhenever I look at your blog in Safari, it looks fine
but when opening in I.E., it has some overlapping issues. I just wanted to give
you a quick heads up! Besides that, fantastic website!
Also visit my homepage; flat screen tv (youtube.com)
This is really a useful blog!! Thank you!
ReplyDelete