Posts

Showing posts from March 13, 2011

STRING PALINDROME USING STACK AND QUEUE

#include<stdio.h> #include<stdlib.h> #include<string.h> void push(char ); char pop(); void nq(char ); char dq(); typedef struct list {     char data;     struct list *next; }node; node *top=NULL,*front=NULL,*rear=NULL; int main() {     char word[20];     printf("Type the Word:");     scanf("%s",word);     int length=strlen(word),i=0;     while(word[i]!='\0')     {         push(word[i]);         nq(word[i]);         i++;     }     for(i=0;i<length;i++)     {         if(pop()!=dq())         break;             }     if(i==length)        ...