Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
381 B
1
Indexable
Never
#include <stdio.h>

int arr[10];
int top = -1;

void push(int a);
int pop();
int peek();
bool isEmpty();
bool isFull();

main(){

}

void push(int a){
    top++;
    arr[top] = a;
}

int pop(){
    //int item = arr[top];
    //top--;
    //return item;
    return arr[top--];
}

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

bool isEmpty();
bool isFull();

Leave a Comment