Skip to content

Commit

Permalink
[Deque] Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
deunlee committed May 26, 2020
1 parent 85543fb commit 0ac758a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Deque/Deque.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ namespace Deun {
return count;
}

inline unsigned int safeMove(unsigned int basis, int diff) {
return basis;
}

// front : 채워진 상태 (단, count가 0이면 비워져 있음)
// rear : 비어있는 상태 (단, count가 size면 채워져 있음)

// front와 rear중 하나는 채워진 상태가, 나머지 하나는 비어있는 상태가 되도록 해야 함
// Deque을 Stack으로 사용하는 경우에는 둘 다 채워져 있거나 둘 다 비어있어도 되지만,
// Deque을 Queue로 사용하는 경우 맨 처음에 들어간 원소가 맨 처음으로 나오지 않게 됨

bool Deque::pushFront(int element) {
if (isFull()) {
return false;
Expand Down

0 comments on commit 0ac758a

Please sign in to comment.