º»¹®/³»¿ë
//--------------------------------------------------------------------
// ±â´É : °¡Àå ³ªÁß¿¡ ÀúÀåµÈ µ¥ÀÌÅ͸¦ ¹ÝȯÇÏ°í ±× Node ¸¦ »èÁ¦ÇÑ´Ù.
// µ¿ÀÛ : top¿¡ ÀúÀåµÈ °ªÀ» ¹ÝȯÇϰí topÀÇ ÁÖ¼Ò¸¦ ÀÌÀü Node ·Î ¹Ù²Û´Ù.
//--------------------------------------------------------------------
template
T Stack::del() // stack ¿¡ ÀúÀåµÈ °ª ¹Ýȯ ¹× »èÁ¦ ÇÔ¼ö
{
Node *current; // Node Çü Æ÷ÀÎÅÍ º¯¼ö ¼±¾ð (ÇöÀçÀÇ À§Ä¡ ÁöÁ¤ Æ÷ÀÎÅÍ)
Node temp; // Node Çü º¯¼ö ¼±¾ð (¹ÝȯÇÒ °ªÀ» ÀúÀåÇÒ º¯¼ö)
current=first; // first ÀÇ °ª current¿¡ ÀúÀå
if (Isempty()) // current °¡ NULLÀ̸é ÀúÀåµÈ°ª ¾øÀ½
{
return 0;
}
else if (current==top) // current °¡ top¿Í °°À¸¸é °ªÀÌ Çϳª ÀÖÀ½
{
temp=*top; // top¿¡ ÀúÀåµÈ °ªÀ» temp º¯¼ö¿¡ ³Ñ°ÜÁÖ°í
delete top; // topÀÇ ³ëµå »èÁ¦
return temp.value; // temp.value(¸¶Áö¸· ÀúÀå°ª) ¹Ýȯ
} else {
while (curre¡¦(»ý·«)