죠노이 노트

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#include <iostream>
 
template <class T>
 
typedef struct Node{
    int data;
}Node;
 
class Stack{
private: Node node;
         int size;
         int num;
         
public: Stack(int size){
        this->size = size;
        num = 0;
        node = new node[size];
        }
    void push(int in){
            node[num++]->data = in;
    }
            
    int pop(){
        return node[--num];
    }
    bool isempty(){if(num == 0return true;}
    
}
cs


'개발 > 자료구조' 카테고리의 다른 글

[자료구조] [C++] CircularQueue 사이클 큐  (0) 2016.11.16
q_sort  (1) 2016.11.16
[자료구조] Select Sort  (0) 2016.10.26
Recursive 를 이용한 Permutation Generator (순열 생성기)  (0) 2016.10.25
Binary Search 이진 탐색  (0) 2016.10.25