Reverse polish notation in C

here is the starter code : 

/* 
 * File:   main.c
 * Author: MSU
 *
 * Created on March 13, 2019, 1:45 PM
 */

#include <stdio.h>
#include <stdlib.h>

#define MAXSIZEI 8
#define MAXSIZEC 7
int top = -1;

int isempty(int stack[]);
int isfull(int stack[]);
int peek(int stack[]);
int pop(int stack[]);
int push(int data, int stack[]);
int printStack(int stack[]);
int size();

int main()
{
    //push item on to the stack
    int stack[8];
    int ssize;
    push(3, stack);
    push(5, stack);
    push(9, stack);
    ssize = size();
    printf(“The size of the stack is: %d\n”, ssize);
    push(1, stack);
    push(12, stack);
    push(15, stack);
    ssize = size();
    printf(“The size of the stack is: %d\n”, ssize);
    
    printf(“Element at top of the stack: %d\n”, peek(stack));
    printStack(stack);
    
    if(isfull(stack) ==1)
        printf(“Stack full\n”);
    else if(isempty(stack)== 1)
        printf(“Stack empty\n”);
    
return 0;    
    
}
int printStack(int stack[])
{
    printf(“Element: \n”);
    while(!isempty(stack)){
        int data = pop(stack);
        printf(“%d\n”, data);
    }
}

int isempty(int stack[])
{
    if(top == -1)
        return 1;
    else 
        return 0;
}

int isfull(int stack[])
{
    if(top == MAXSIZEI)
        return 1;
    else
        return 0;
}

int peek(int stack[])
{
    return stack[top];
}

int pop(int stack[])
{
    int data;
    
    if(!isempty(stack)){
        data = stack[top];
        top = top – 1;
        return data;
    } else{
        printf(“Could not retrieve data, Stack is empty”);
        
    }
}

int push(int data, int stack[]){
    
    if(!isfull(stack)){
        top = top + 1;
        stack[top] = data;
    } else{
        printf(“Count not insert data. Stack is full.\n”);
    }
}
int size()
{
    return top + 1;
}

Place your order
(550 words)

Approximate price: $22

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency
Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our Guarantees

Money-back Guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism Guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision Policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy Policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation Guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more