Write a program that read an expression and tell the user whether the bracket are correct or not (brackets checker)
for example:
( 3 * 4 + 2 ) / ( 8 - 2 ) is correct
while the expreesion ( 3 * 4 + 2 ( / (8-2) is incorrect
i wrote this incomplete prog...... please help me to complete it...
the code....
#include<stdio.h>
#include<conio.h>
#include<stdlib.h>
struct Node;
typedef struct Node * PtrToNode;
struct Node
{
int element;
PtrToNode Next;
};
PtrToNode MakeEmpty(PtrToNode L)
{
L= new(Node);
L->Next=NULL;
return L;
}
void Push(PtrToNode L,int x)
{
PtrToNode S;
S= new(Node);
S->element=x;
S->Next=L->Next;
L->Next=S;
}
int Pop(PtrToNode L)
{
PtrToNode P;
P=L->Next;
int x=P->element;
L->Next=P->Next;
free(P);
return x;
}