Already have an account? Get multiple benefits of using own account!
Login in your account..!
Remember me
Don't have an account? Create your account in less than a minutes,
Forgot password? how can I recover my password now!
Enter right registered email to receive password!
Example of structure:
struct item
{
int element;
node_ptr next;
};
typedef node_ptr stack;
stack create(void)
stack s;
s=(stack)malloc(sizeof(struct item));
s->next=NULL;
return s;
}
void push(stack s,int a)
node_ptr temp;
temp=(node_ptr)malloc(sizeof(struct item));
temp->element=a;
temp->next=s->next;
s->next=temp;
int is_empty(stack s)
return(s->next==NULL);
void pop(stack s)
temp=s->next;
s->next=temp->next;
free(temp);
int top(stack s)
return(s->next->element);
void main()
char exp[100];
int i;
s=create();
clrscr();
printf("Enter an expression\n");
scanf("%s",exp);
for(i=0;exp[i];i++)
if(exp[i]=='('||exp[i]=='['||exp[i]=='{')
push(s,exp[i]);
else
if(exp[i]==')')
if(top(s)!='(')
printf("Invalid Expression");
return;
pop(s);
if(exp[i]=='}')
if(top(s)!='{')
if(exp[i]==']')
if(top(s)!='[')
if(!is_empty(s))
#questionAt a shop of marbles, packs of marbles are prepared. Packets are named A, B, C, D, E …….. All packets are kept in a VERTICAL SHELF in random order. Any numbers of packets
Write a program which incorporates a function named compute and which is used to calculate the area and circumference of a circle. Use the main function for inputs and outputs.
Problem Description There is a pebble merchant. He sells the pebbles, that are used for shining the floor. His main duty is to take the length of the room’s sides. But he sometime
Most first graders know that nine hundred and ninety nine plus one is one thousand, but C++ doesn't! Sure, a computer can easily compute 999 + 1 and get 1000. But reading and writi
Explain the For Loop - Computer Programming? Similar to the while statement, for loop is an entry controlled loop and the code of the for loop will be executed itereatively. Th
Relational Operators A relational operator is used to make comparison among two values. All these operators are binary and needs two operands. There are the following relationa
Problem #1: plugging the memory leak. When you employ the "normal" new operator, for example Foo* p = new Foo(), the compiler generates some special code to manage the case while t
C++ Help
C program to add, average and deviation of numbers: void main() { int sum=0,a[10],i; float avg=0,dev,vari=0,var; pri
(a) Write a recursive procedure (digits n) that computes the number of digits in the integer n using a linear recursive process. For example, (digits 42) should return 2 and (digit
Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!
whatsapp: +1-415-670-9521
Phone: +1-415-670-9521
Email: [email protected]
All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd