public T Pop() { if (IsEmpty()) { Console.WriteLine("Stek is empty "); return(default(T)); } if (position == array.Capacity() - 1) { Console.WriteLine("Stek is empty "); return(default(T)); } //return array[++position]; return(array.Get(++position)); }
public T Dequeue() { if (count == 0) { Console.WriteLine("Queue is empty "); return(default(T)); } ; T k = array.Get(tail); tail++; count--; Console.WriteLine("tail---" + tail); Console.WriteLine("elements in queue---" + count); //return array[k]; return(k); }