Stack push{
if size() = N then
throw StackFull exception
t<-t + 1
S[t]<-e
}
Stack pop{
if empty() then
throw StackEmpty exception
t<-t-1
}
enqueue{
if size() = N then
throw QueueFull exception
Q[r] <- 2
r <- (r+1) mod N
n = n+1
}
dequeue{
if empty() then
throw QueueEmpty exception
f <- (f+1) mod N
n = n-1
}
'학교 > 자료구조' 카테고리의 다른 글
[정렬] 선택정렬과 삽입정렬 (1) | 2016.11.05 |
---|---|
[정렬] 버블소트 (0) | 2016.03.30 |
[정렬] sorting의 종류와 효율 (0) | 2016.03.28 |
STL container -ing (0) | 2016.03.19 |
기초 Algorithm(1) (0) | 2015.10.29 |