@@ -25,7 +25,7 @@ void push(struct Stack *p, char ch); // pust element in stack
25
25
char pop (struct Stack * p ); // pop topmost element from the stack
26
26
int isOprnd (char ch ); // check if element is operand or not
27
27
int isEmpty (struct Stack s ); // check if stack is empty
28
- int prcnd (char op1 , char op2 ); // check operator precedence
28
+ int getPrecedence (char op1 , char op2 ); // check operator precedence
29
29
void convert (char infix [],
30
30
char postfix []); // convert infix to postfix expression
31
31
@@ -164,7 +164,7 @@ void convert(char infix[], char postfix[])
164
164
{
165
165
while (isEmpty (s ) == 0 ) // check if stack is empty
166
166
{
167
- pr = prcnd (ch ,
167
+ pr = getPrecedence (ch ,
168
168
s .arr [s .tos ]); // check operator precedence
169
169
170
170
if (pr == 1 )
@@ -193,12 +193,12 @@ void convert(char infix[], char postfix[])
193
193
}
194
194
195
195
/**
196
- * @brief prcnd function
196
+ * @brief getPrecedence function returns the precedence after comparing two operators passed as parameter.
197
197
* @param op1 : first operator
198
198
* @param op2 : second operator
199
199
* @returns 1 or 0 on exit
200
200
*/
201
- int prcnd (char op1 , char op2 )
201
+ int getPrecedence (char op1 , char op2 )
202
202
{
203
203
if (op2 == '$' )
204
204
{
0 commit comments