[Library] Ngăn xếp (L_STKLIB)

File
#include <stdio.h>
#include <conio.h>
#include <D:\Student\Curriculum\1 Cau truc du lieu\Thuc hanh\ALISTLIB.CPP>

//Khai bao danh sach cai dat bang ngan xep
typedef List Stack;

//Tao ngan xep rong
void MakeNull_Stack(Stack *S){
     MakeNull_List(S);
     }

// Ham kiem tra ngan xep rong
int Empty_Stack(Stack S){
    return Empty_List(S);
}

//Ham kiem tra ngan xep day
int Full_Stack(Stack S){
    return Full_List(S);
}

//Ham lay noi dung phan tu tai dinh cua ngan xep
ElementType Top(Stack S){
            return Retrieve(FirstList(S),S);
            }

//Them phan tu vao ngan xep
void Push(ElementType X, Stack *S){
     Insert_List(X,FirstList(*S),S);
     }

//Xoa phan tu ra khoi ngan xep
void Pop(Stack *S){
     Delete_List(FirstList(*S),S);
     }

Kita welcomes your comments...

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

w

Connecting to %s