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))
Selecting Array Elements Implement the following C++ code in assembly language, using the block-structured .IF and .WHILE directives. Assume that all variables are 32-bit signed in
Create a user-defined data structure (struct) called Node that represents a node within a linked list where the "data" stored in each node is a pointer to a Car object. a) Wr
Using Figure 10.2 as a model, illustrate the result of each operation in the sequence ENQUEUE.Q; 4/, ENQUEUE.Q; 1/, ENQUEUE.Q; 3/, DEQUEUE.Q/, ENQUEUE.Q; 8/, and DEQUEUE.Q/ on an i
Explain the class invariant. - It's a condition that ensures correct working of a class and defines all the valid states for an object. - When an object is created class inv
Determine the types of Container class Container class can be of 2 types: - Heterogeneous container - Here container class comprise a group of mixed objects - Homogeneou
convert BST into sorted doubly linked list
Railway station simulation code in c programming
Question : (a) Define a Pointer. Provide an example of an integer pointer variable. (b) Give advantages of using pointers over arrays. (c) Declare an integer pointer
Change the matrix program (program 3) slightly. Overload == operator to compare two matrices to be added or subtracted. i.e., whether the column of first and the row of second
#q•Design and code a new function that accepts as parameters the gross pay by value and the federal tax, state tax, local tax, SS tax, and net Pay by reference. Calculate the taxes
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