You are on page 1of 18

Index

Sr. No. Contents Page No.

Annexure I– Micro Project Proposal 1-2

1.Aims/Benefits of the Micro-Project 1

2. Course Outcome Addressed 1

1 3.Proposed Methodology 1

4. Action Plan 2

5. Resources Required 2

6. Name of Team Members with Roll No.’s 3

Annexure II – Micro Project Report 3-8

1.Rationale 4

2.Aims/Benefits of the Micro-Project 4

3.Course Outcome Achieved 4

4. Literature Review 5

2 5.Actual Methodology Followed/Algoritm 6

5.1 Flow chart 7-8

5.2 Source code 9-14

6.Actual Resources Used 15

7.Outputs of Micro-Projects 16

8. Skill developed / Learning out of this Micro-Project 17

9. Applications of this Micro-Project 17


Annexure I

Micro Project Proposal

INFIX TO PREFIX AND ITS EVALUTION

1. Aims/Benefits of the Micro-Project:

Conversion of Infix Expression to prefix expression using stack. To


understand prefix, infix, and postfix expression.

2. Course Outcome Addressed:

a..Perform basic opetations of array

b.Implement basic operation on stack and queue using array representation.

3. Proposed Methodology:

In this micro project we are perform conversion of infix expression to prefix


expression using stack and we perform Evalution of prefix.

VAPM.Almala Page 1
4. Action Plan :

Sr. Name of Responsible


Planned Planned
No Details of Activity Team Members
Start date Finish date
.
1 Search the topic 8-July-2019 9-July-2019
2:00-3:00pm 2:00-3:00pm
2 Search the information 15-July-2019 22-July-2019
2:00-3:50pm 2:00-3:50pm
3 Algorithm developing 23-July-2019 29-July-2019
2:00-3:00pm 2:00-3:00pm Nalle Krishna
4 Flowchart developing 3o-July-2019 6-Aug-2019
2:00-3:50pm 2:00-3:50pm Potdar vaishnavi
5 Function making 13-Aug-2019 27-Aug-2019
2:00-3:00pm 2:00-3:00pm Wagdare vaibhavi
6 Coding developing 9-sep-2019 23-Sep-2019
2:00-3:00pm 2:00-3:00pm
7 Debugging 16-sep-2019 30-Sep-2019
2:00-3:50pm 2:00-3:50pm
8 Finalizing Project with its 7-oct-2019 14-oct-2019
report 2:00-3:50pm 2:00-3:50pm

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

3 Compiler Turbo C/GCC 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.

1 1810950144 Potdar vaishnavi 14


2 1810950154 Nalle krishna 18

3 1810950158 Wagdare vaibhavi 24

Name and Signature of the Teacher

VAPM.Almala Page 3
Annexure – II

Micro-Project Report

INFIX TO PREFIX AND ITS EVALUTION

1. Rationale:

Data structure is an important aspect for computer engineering and


information technology diploma graduadtes.data structure is a logical and
mathematical model of storing orgonizing data in a particular way in a
computer .the methods of data structure are widtely used in industries. after
learning this subject student will be able to identify the problem, diffrent
algorithums to solve the problems choose the most appropriate data structure
to represent the data.

2. Aims/Benefits of the Micro-Project:

Evaluation expression using stack.

3. Course Outcomes Achieved:

a..Perform basic opetations of array

b.Implement basic operation on stack and queue using array representation.

VAPM.Almala Page 4
4. Literature Review:

In computer science, a stack is an abstract datatype that serves as a collection of


elements, with two principal operations:

• push, which adds an element to the collection, and


• pop, which removes the most recently added element that was not yet
removed.

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.

Considered as a linear data structure, or more abstractly a sequential


collection, the push and pop operations occur only at one end of the
structure, referred to as the top of the stack. This makes it possible to
implement a stack as a single linked list and a pointer to the top element. A
VAPM.Almala Page 5
stack may be implemented to have a bounded capacity. If the stack is full and
does not contain enough space to accept an entity to be pushed, the stack is
then considered to be in an overflow state. The pop operation removes an
item from the top of the stack

5 Actual Methodology Followed:

Algorithm

EVALUATE PREFIX EXPRESSION:

Step 1: Put a pointer P at the end of the end

Step 2: If character at P is an operand push it to Stack

Step 3: If the character at P is an operator pop two

elements from the Stack. Operate on these elements

according to the operator, and push the result

back to the Stack

Step 4: Decrement P by 1 and go to Step 2 as long as there

are characters left to be scanned in the expression.

Step 5: The Result is stored at the top of the Stack,

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>

char s[SIZE]; int top=-1;

push(char elem)

s[++top]=elem;

char pop()

return(s[top--]);

int pr(char elem)

switch(elem)

case '#': return 0;

case ')': return 1;

case '+':

case '-': return 2;

case '*':

case '/':return 3;

VAPM.Almala Page 9
}

main()

char infx[50],prfx[50],ch,elem;

int i=0,k=0;

printf("\n\nRead the Infix Expression ? ");

scanf("%s",infx);

push('#');

strrev(infx);

while( (ch=infx[i++]) != '\0')

if( ch == ')')

push(ch);

else if(isalnum(ch))

prfx[k++]=ch;

else if( ch == '(')

while( s[top] != ')')

prfx[k++]=pop();

elem=pop();

else

while( pr(s[top]) >= pr(ch) )

prfx[k++]=pop(); push(ch);

VAPM.Almala Page 10
}

while( s[top] != '#')

prfx[k++]=pop();

prfx[k]='\0';

strrev(prfx);

strrev(infx);

printf("\n\nGiven Infix Expn: %s \nPrefix Expn: %s\n",infx,prfx);

VAPM.Almala Page 11
EVALUTION OF PREFIX:-

#include<stdio.h>
#include<ctype.h>
#include<stdlib.h>
#define Max 20
int st[Max], top=-1;

void push(int ch)


{
if (top == Max-1)
{
printf("Stack is full\n");
}
else
{
top++;
st[top]=ch;
}
}

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");
}

int PreEval(char s[25])


{
char temp[25];
int i,val=0,ch1,ch2,j=0;
i=0; top=-1;
while (s[i]!='\0')
{
/*if operand is countered print it*/
if ( (s[i]>=48 && s[i]<=57) )
{
j=0;
temp[j]=s[i];
j++;
temp[j]='\0';
push(atoi(temp));
}
else
{
ch2=pop();
ch1=pop();
switch(s[i])
{
case '+' :{
val=ch2+ch1;
break;
}
case '-' :{
val=ch2-ch1;
break;
}
case '*' :{
val=ch2*ch1;
break;

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:

Sr. Name of resource /


Specification Quantity Remarks
No. material

1 Computer WINDOWS 7,2GB RAM, 1


160GB HDD
2 Operating System WINDOWS 7 1

3 Compiler Turbo C/GCC 1

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

There are so many thing that we learn from this project of

1. We learn that how to make the project in DSU.


2. How to do the testing of program in turbo c.
3. How to collect the information and how to make the presentation that we
learn from this project.
4. We develop our logic implementation for programing and coding.
5. This all thing we learn from this project.

9. Applications of this Micro-Project:

1.Polish prefix notations.

2.Expression evaluate.

*********

VAPM.Almala Page 17

You might also like