Displaying Source Code(s)
|
|
Infix to Prefix notation using linked lists
--------------------------------------------------------------------------------
Description : This program is useful for converting an Infix
expression to Prefix expression.
/* Program to convert Infix to Prefix Notation
Author:SRINIVASA SARMA B
Email :sarma_433@yahoo.com
*/
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
struct link_list
{
char data;
struct link_list *next;
}*front,*temp,*p;
char pop();
void push(char);
int prcd(char,char);
int isoperand(char);
void main()
{
char infix[15],c,prefix[15],s;/* use pointers for lengthy
expressions*/
int i=0,k=0;
front=NULL;
clrscr();
printf("Enter the infix expression:");
scanf("%s",infix);
strrev(infix);
while(infix[i]!='
|
|
|