Professional Documents
Culture Documents
1 3.Proposed Methodology 1
4. Action Plan 2
5. Resources Required 2
1.Rationale 4
4. Literature Review 5
7.Outputs of Micro-Projects 16
3. Proposed Methodology:
VAPM.Almala Page 1
4. Action Plan :
5. Resources Required
Sr.
No Name of resource / material Specification Quantity Remarks
.
1 Computer WINDOWS 7,2GB RAM, 1
160GB HDD
2 Operating System WINDOWS 7 1
4 Browser Chrome 1
VAPM.Almala Page 2
Names of Team Members with Roll No.’s:
Sr.
Enrollment No. Name of Team Member Roll No.
No.
VAPM.Almala Page 3
Annexure – II
Micro-Project Report
1. Rationale:
VAPM.Almala Page 4
4. Literature Review:
The order in which elements come off a stack gives rise to its alternative
name, LIFO (last in, first out). Additionally, a peek operation may give access
to the top without modifying the stack. The name "stack" for this type of
structure comes from the analogy to a set of physical items stacked on top of
each other, which makes it easy to take an item off the top of the stack, while
getting to an item deeper in the stack may require taking off multiple other items
first.
Algorithm
return it
Step 6: End
VAPM.Almala Page 6
Flow chart:-
INFIX TO PREFIX:-
VAPM.Almala Page 7
EVALUTION OF PREFIX
VAPM.Almala Page 8
5.2 Source Code:-
INFIX TO PREFIX :-
#define SIZE 50
#include<string.h>
#include <ctype.h>
#include<stdio.h>
push(char elem)
s[++top]=elem;
char pop()
return(s[top--]);
switch(elem)
case '+':
case '*':
case '/':return 3;
VAPM.Almala Page 9
}
main()
char infx[50],prfx[50],ch,elem;
int i=0,k=0;
scanf("%s",infx);
push('#');
strrev(infx);
if( ch == ')')
push(ch);
else if(isalnum(ch))
prfx[k++]=ch;
prfx[k++]=pop();
elem=pop();
else
prfx[k++]=pop(); push(ch);
VAPM.Almala Page 10
}
prfx[k++]=pop();
prfx[k]='\0';
strrev(prfx);
strrev(infx);
VAPM.Almala Page 11
EVALUTION OF PREFIX:-
#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#define Max 20
int st[Max], top=-1;
int pop()
{
int ch;
if (top==-1)
{
printf("Stack is empty\n");
}
else
{
ch=st[top];
top--;
}
return ch;
}
void dispstack()
{
int k;
printf("stack Content: ");
for (k=top; k>=0; k--)
{
VAPM.Almala Page 12
printf("%d, ", st[k]);
}
printf("\n");
}
VAPM.Almala Page 13
}
case '/' :{
val=ch2/ch1;
break;
}
}
push(val);
}
i++;
}
val=pop();
return val;
}
void main()
{
char s[25],s1[25];
int val;
clrscr();
printf("enter a Prefix expression for evaluation\n");
scanf("%s",s);
strcpy(s1,strrev(s));
val= PreEval(s1);
printf("Value of Prefix Expression=%d\n", val);
getch();
}
VAPM.Almala Page 14
6. Actual Resources Used:
4 Browser Chrome 1
VAPM.Almala Page 15
7. Outputs of Micro-Projects:
INFIX TO PREFIX:-
EVALUTION OF PREFIX:-
VAPM.Almala Page 16
8. Skill developed / Learning out of this Micro-Project:
Adds skills developed as per your micro project. Some example is given below
2.Expression evaluate.
*********
VAPM.Almala Page 17