Skip to content

Commit

Permalink
[Stack] Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
deunlee committed May 25, 2020
1 parent 3b75154 commit bca2cb2
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions Stack/Stack.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace Deun {
class Stack {
private:
int* elements;
unsigned int size;
unsigned int top;
unsigned int size; // 스택의 크기 (배열 원소의 개수)
unsigned int top; // 원소를 삽입/삭제할 자리

public:
Stack(unsigned int size = 100);
Expand All @@ -23,12 +23,12 @@ namespace Deun {
bool isEmpty();
bool isFull();

unsigned int getSize();
unsigned int getCount();
unsigned int getSize(); // 전체 크기 반환
unsigned int getCount(); // 채워진 원소의 개수 반환

bool push(int element);
int pop();
int peek();
bool push(int element); // 맨 뒤에 원소 삽입 (성공 = true, 실패 = false)
int pop(); // 맨 뒤 원소 반환 및 삭제 (실패 = throw)
int peek(); // 맨 뒤 원소 반환 (실패 = throw)
};
}

Expand Down

0 comments on commit bca2cb2

Please sign in to comment.